library(tidyverse)
library(plotly)
library(sf)
library(mapview)
library(tigris)
library(censusapi)
library(leaflet)
library(lehdr)
library(usmap)
library(lmtest)
library(pracma)
library(lmtest)
library(forecast)
library(vars)
library(rvest)
library(RSelenium)
library(seleniumPipes)
library(dLagM)
library(jsonlite)
library(rgdal)
library(esri2sf)
library(readr)
options(
tigris_class = "sf",
tigris_use_cache = TRUE
)
Sys.setenv(CENSUS_KEY="10dcd73d7c043e91bac9fb8d3989cbff54b08790")
# SET your path here to the covid19analysis folder.
sg_path <- '/Users/simonespeizer/pCloud Drive/Shared/SFBI/Restricted Data Library/Safegraph/covid19analysis/'
sg_hourly_path <- '/Users/simonespeizer/pCloud Drive/Shared/SFBI/Restricted Data Library/Safegraph/covid19analysis/weekly-patterns/v2/hourly/'
In this Rmd, I explore the predictive ability of visits over time.
Here I look at each week of visits data, from Monday to Monday, and see how well that week of visits data predicts the change in cases over one week, two weeks later. The week of visits data includes 7 days; the change in cases is from day 1 through day 8. For example, the first week of visits data, 3/9-3/15, is compared to the change in cases from 3/23 to 3/30.
For each set of dates, the code below outputs five different models:
-For change in cases, using all data
-For change in cases, using only data where the starting number of cases is greater than 0
-For change in log of cases, using only data where the starting number of cases is greater than 0
-For change in cases, using only data where the starting number of cases is greater than or equal to 10
-For change in log of cases, using only data where the starting number of cases is greater than or equal to 10
Each of these is run as just visits and change in (log of) cases in a model, as well as visits + demographic variables and change in (log of) cases.
# load the data
# load block groups and their correspondence to ZCTAs
ac_bg_zctas <- readRDS("Simone_Speizer/ac_bg_ztcas.rds")
ac_bgs <- ac_bg_zctas %>% pull(blockgroup)
# load the case data
# note this is downloaded manually
ac_place_cases <- read.csv("Simone_Speizer/Alameda_County_Cumulative_Cases_By_Place_And_Zip.csv")
# handle the ones that are reported as <10 by calling them 5 cases. Note this is a simplification/choice I made and could be changed.
ac_cases_zip <- ac_place_cases %>%
rename(date = DtCreate) %>%
mutate(date = date %>% substr(1,10) %>% as.Date()) %>%
dplyr::select(c(date, contains("F9"))) %>% # only select zip code data
gather(key = "zipcode", value = "cases", -date) %>%
mutate(cases = ifelse(cases == "<10", "5", cases),
zipcode = zipcode %>% substr(2,6)) %>% # replace cases <10 with 10 and remove the "F" from zipcode names
mutate(cases = as.numeric(cases)) %>%
arrange(date)
# get Alameda County populations by zip code
# census data
acs_vars = readRDS("Simone_Speizer/censusData2018_acs_acs5.rds")
# define a function for pulling census data
pullCensus <- function(variableToPull, county) {
regionString <- paste0("state:06+county:", county)
censusData <- getCensus(
name = "acs/acs5",
vintage = 2018,
region = "block group:*",
regionin = regionString,
vars = variableToPull
) %>%
mutate(blockgroup = paste0(state,county,tract,block_group)) %>%
select_if(!names(.) %in% c("GEO_ID","state","county","tract","block_group","NAME"))
return(censusData)
}
# get population data
ac_fips <- fips("CA", "Alameda") %>% substr(3,5)
ac_pop_zip <- pullCensus("B01003_001E", ac_fips) %>%
left_join(ac_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_pop_zip = sum(B01003_001E))
# join with cases
ac_cases_zip <- ac_cases_zip %>% left_join(ac_pop_zip) %>%
mutate(cases_by_pop = cases / total_pop_zip)
# load the visits data, weighted, version 1. this also contains the unweighted data in the total_visits column
ac_visits_zip_1 <- readRDS(paste0(sg_path, "weekly-patterns/v2/ac_zip_visits_daily_sum_hourly_weighted_v1_03-09-20_05-24-20.rds"))
ac_visits_zip_2 <- readRDS(paste0(sg_path, "weekly-patterns/v2/ac_zip_visits_daily_sum_hourly_weighted_v1_05-25-20_06-21-20.rds"))
ac_visits_zip <- rbind(ac_visits_zip_1, ac_visits_zip_2)
# calculate cumulative visits over time
ac_cum_visits_zip <- ac_visits_zip %>%
dplyr::select(zipcode, date, total_visits) %>%
mutate(total_visits = replace_na(total_visits, 0)) %>% # replace NAs with zero so they don't lead to NAs all following that date
group_by(zipcode) %>%
mutate(cumulative_visits = cumsum(total_visits)) %>%
left_join(ac_pop_zip) %>%
mutate(cum_visits_per_capita = cumulative_visits / total_pop_zip)
# get visits per capita
ac_visits_zip <- ac_visits_zip %>% left_join(ac_pop_zip) %>%
mutate(weighted_visits_per_capita = total_weighted_visits / total_pop_zip,
weighted_visit_hours_per_capita = total_weighted_visit_hours / total_pop_zip,
weighted_visit_hours_per_capita_v2 = total_weighted_visit_hours_v2 / total_pop_zip,
visits_per_capita = total_visits / total_pop_zip,
visit_hours_per_capita = total_visit_hours / total_pop_zip,
visits_per_area_per_capita = total_visits_per_area / total_pop_zip)
# function to make plots (which doesn't seem to work in a loop) and run analyses based on given weeks of data
# note that this sets up to be able to compare to visit hours as well
# visits_zip has the daily visits data, cases_zip the daily cases data, cases_start_date is the first date for cases data to look at, time_window_length is the length of time over which to look at change in cases (in days), visits_lag is the lag on the visits data relative to the cases data (in days), dem_data is the zip code level demographic data, county_name is the name of the county as a string
# returns the coefficient on visits, the p value of that coefficient, and the r squared of the model for 5 different models -- all data and change in cases, only nonzero starting cases and change in cases, only nonzero starting cases and change in log of cases, only >= 10 starting cases and change in cases, and only >= 10 starting cases and change in log of cases
testVisitsPrediction <- function(visits_zip, cases_zip, cases_start_date, time_window_length, visits_lag, dem_data, county_name) {
cases_end_date_inc <- cases_start_date + time_window_length
visits_start_date <- cases_start_date - visits_lag
visits_end_date_exc <- visits_start_date + time_window_length
print(paste0("Cases start date: ", cases_start_date))
print(paste0("Visits start date: ", visits_start_date))
init_cases <- cases_zip %>%
filter(date == cases_start_date) %>%
dplyr::select(zipcode, cases_by_pop, cases) %>%
rename(init_cases_by_pop = cases_by_pop, init_cases = cases) %>%
mutate(log_init_cases_by_pop = log(init_cases_by_pop))
# max cases (end date)
final_cases <- cases_zip %>%
filter(date == cases_end_date_inc) %>%
dplyr::select(zipcode, cases_by_pop, total_pop_zip, cases) %>%
rename(fin_cases_by_pop = cases_by_pop, fin_cases = cases) %>%
mutate(log_fin_cases_by_pop = log(fin_cases_by_pop))
# summarize visits add current and initial cases
visits_cases_change <- visits_zip %>%
filter(date >= visits_start_date & date < visits_end_date_exc) %>%
filter(!is.na(zipcode) & !is.na(total_visits)) %>%
group_by(zipcode) %>%
summarize(total_visits_per_capita = sum(visits_per_capita),
# total_weighted_visits_per_capita = sum(weighted_visits_per_capita),
# total_weighted_visit_hours_per_capita = sum(weighted_visit_hours_per_capita),
# total_weighted_visit_hours_per_capita_v2 = sum(weighted_visit_hours_per_capita_v2),
# total_visit_hours_per_capita = sum(visit_hours_per_capita),
# total_visits_per_area_per_capita = sum(visits_per_area_per_capita),
total_visits = sum(total_visits)) %>%
left_join(final_cases) %>%
left_join(init_cases) %>%
filter(!is.na(fin_cases_by_pop)) %>%
mutate(change_log_cases_by_pop = log_fin_cases_by_pop - log_init_cases_by_pop,
change_cases_by_pop = fin_cases_by_pop - init_cases_by_pop)
visits_cases_change_start_non0 <- visits_cases_change %>% filter(init_cases_by_pop > 0)
# get linear model values
visits_cases_change_model <- lm(change_cases_by_pop ~ total_visits_per_capita, visits_cases_change)
visits_cases_change_model_non0 <- lm(change_cases_by_pop ~ total_visits_per_capita, visits_cases_change_start_non0)
visits_cases_change_model_log <- lm(change_log_cases_by_pop ~ total_visits_per_capita, visits_cases_change_start_non0)
# plots and output the model values
plot_1 <- visits_cases_change %>%
plot_ly() %>%
add_trace(x = ~total_visits_per_capita, y = ~change_cases_by_pop, type = 'scatter', mode = 'markers', text = ~zipcode) %>%
add_trace(x = ~total_visits_per_capita, y = fitted(visits_cases_change_model), mode = 'lines', showlegend = F, text = paste0("R squared: ", summary.lm(visits_cases_change_model)$r.squared, ", slope: ", visits_cases_change_model$coefficients[2])) %>%
layout(xaxis = list(title = paste0('Total visits per person from ', visits_start_date, " through ", visits_end_date_exc - 1)), yaxis = list(title = paste0('Change in cases per person from ', cases_start_date, " to ", cases_end_date_inc)), title = county_name)
print(summary(visits_cases_change_model))
print("Control for demographic variables:")
visits_cases_change_dem <- left_join(visits_cases_change, dem_data)
print(summary(lm(change_cases_by_pop ~ total_visits_per_capita + percent_under_125000 + avg_household_size + pop_density + `percent more than 1 occupant` + `percent more than 1 unit` + avg_median_age, data = visits_cases_change_dem)))
plot_1
# exclude ones that started with zero
plot_2 <- visits_cases_change_start_non0 %>%
plot_ly() %>%
add_trace(x = ~total_visits_per_capita, y = ~change_cases_by_pop, type = 'scatter', mode = 'markers', text = ~zipcode) %>%
add_trace(x = ~total_visits_per_capita, y = fitted(visits_cases_change_model_non0), mode = 'lines', showlegend = F, text = paste0("R squared: ", summary.lm(visits_cases_change_model_non0)$r.squared, ", slope: ", visits_cases_change_model_non0$coefficients[2])) %>%
layout(xaxis = list(title = paste0('Total visits per person from ', visits_start_date, " through ", visits_end_date_exc - 1)), yaxis = list(title = paste0('Change in cases per person from ', cases_start_date, " to ", cases_end_date_inc)), title = paste0(county_name, "only nonzero starting cases"))
print(summary(visits_cases_change_model_non0))
print("Control for demographic variables:")
visits_cases_change_non0_dem <- left_join(visits_cases_change_start_non0, dem_data)
print(summary(lm(change_cases_by_pop ~ total_visits_per_capita + percent_under_125000 + avg_household_size + pop_density + `percent more than 1 occupant` + `percent more than 1 unit` + avg_median_age, data = visits_cases_change_non0_dem)))
plot_2
# log of cases
plot_3 <- visits_cases_change_start_non0 %>%
plot_ly() %>%
add_trace(x = ~total_visits_per_capita, y = ~change_log_cases_by_pop, type = 'scatter', mode = 'markers', text = ~zipcode) %>%
add_trace(x = ~total_visits_per_capita, y = fitted(visits_cases_change_model_log), mode = 'lines', showlegend = F, text = paste0("R squared: ", summary.lm(visits_cases_change_model_log)$r.squared, ", slope: ", visits_cases_change_model_log$coefficients[2])) %>%
layout(xaxis = list(title = paste0('Total visits per person from ', visits_start_date, " through ", visits_end_date_exc - 1)), yaxis = list(title = paste0('Change in log(cases per person) from ', cases_start_date, " to ", cases_end_date_inc)), title = paste0(county_name, "only nonzero starting cases"))
print(summary(visits_cases_change_model_log))
print("Control for demographic variables:")
print(summary(lm(change_log_cases_by_pop ~ total_visits_per_capita + percent_under_125000 + avg_household_size + pop_density + `percent more than 1 occupant` + `percent more than 1 unit` + avg_median_age, data = visits_cases_change_non0_dem)))
plot_3
# try excluding values that started below 10 cases
visits_cases_change_exc <- visits_cases_change %>% filter(init_cases >= 10)
visits_cases_change_model_exc <- NA
visits_cases_change_model_exc_log <- NA
if (nrow(visits_cases_change_exc) > 0) {
visits_cases_change_model_exc <- lm(change_cases_by_pop ~ total_visits_per_capita, visits_cases_change_exc)
visits_cases_change_model_exc_log <- lm(change_log_cases_by_pop ~ total_visits_per_capita, visits_cases_change_exc)
# plots and output the model values
plot_4 <- visits_cases_change_exc %>%
plot_ly() %>%
add_trace(x = ~total_visits_per_capita, y = ~change_cases_by_pop, type = 'scatter', mode = 'markers', text = ~zipcode) %>%
add_trace(x = ~total_visits_per_capita, y = fitted(visits_cases_change_model_exc), mode = 'lines', showlegend = F, text = paste0("R squared: ", summary.lm(visits_cases_change_model_exc)$r.squared, ", slope: ", visits_cases_change_model_exc$coefficients[2])) %>%
layout(xaxis = list(title = paste0('Total visits per person from ', visits_start_date, " through ", visits_end_date_exc - 1)), yaxis = list(title = paste0('Change in cases per person from ', cases_start_date, " to ", cases_end_date_inc)), title = paste0(county_name, "only starting cases >= 10"))
print(summary(visits_cases_change_model_exc))
print("Control for demographic variables:")
visits_cases_change_dem_exc <- left_join(visits_cases_change_exc, dem_data)
print(summary(lm(change_cases_by_pop ~ total_visits_per_capita + percent_under_125000 + avg_household_size + pop_density + `percent more than 1 occupant` + `percent more than 1 unit` + avg_median_age, data = visits_cases_change_dem_exc)))
plot_4
# log of cases
plot_5<- visits_cases_change_exc %>%
plot_ly() %>%
add_trace(x = ~total_visits_per_capita, y = ~change_log_cases_by_pop, type = 'scatter', mode = 'markers', text = ~zipcode) %>%
add_trace(x = ~total_visits_per_capita, y = fitted(visits_cases_change_model_exc_log), mode = 'lines', showlegend = F, text = paste0("R squared: ", summary.lm(visits_cases_change_model_exc_log)$r.squared, ", slope: ", visits_cases_change_model_exc_log$coefficients[2])) %>%
layout(xaxis = list(title = paste0('Total visits per person from ', visits_start_date, " through ", visits_end_date_exc - 1)), yaxis = list(title = paste0('Change in log(cases per person) from ', cases_start_date, " to ", cases_end_date_inc)), title = paste0(county_name, "only starting cases >= 10"))
print(summary(visits_cases_change_model_exc_log))
print("Control for demographic variables:")
print(summary(lm(change_log_cases_by_pop ~ total_visits_per_capita + percent_under_125000 + avg_household_size + pop_density + `percent more than 1 occupant` + `percent more than 1 unit` + avg_median_age, data = visits_cases_change_dem_exc)))
plot_5
}
return_vals <- data.frame(model_type = character(), coef_val = numeric(), p_val = numeric(), r_squared = numeric(), cases_start_date = character(), stringsAsFactors = FALSE)
cases_change <- data.frame("change in cases", summary(visits_cases_change_model)$coefficients[2,1], summary(visits_cases_change_model)$coefficients[2,4], summary(visits_cases_change_model)$r.squared, as.character(cases_start_date), stringsAsFactors = FALSE)
colnames(cases_change) <- c("model_type", "coef_val", "p_val", "r_squared", "cases_start_date")
cases_change_no0 <- data.frame("change in cases, starting above 0", summary(visits_cases_change_model_non0)$coefficients[2,1], summary(visits_cases_change_model_non0)$coefficients[2,4], summary(visits_cases_change_model_non0)$r.squared, as.character(cases_start_date), stringsAsFactors = FALSE)
colnames(cases_change_no0) <- c("model_type", "coef_val", "p_val", "r_squared", "cases_start_date")
cases_change_log <- data.frame("change in log of cases, starting above 0", summary(visits_cases_change_model_log)$coefficients[2,1], summary(visits_cases_change_model_log)$coefficients[2,4], summary(visits_cases_change_model_log)$r.squared, as.character(cases_start_date), stringsAsFactors = FALSE)
colnames(cases_change_log) <- c("model_type", "coef_val", "p_val", "r_squared", "cases_start_date")
return_vals <- rbind(return_vals, cases_change, cases_change_no0, cases_change_log)
# include the later two if there was more than one point in the model
if (nrow(visits_cases_change_exc) > 1) {
cases_change_10 <- data.frame("change in cases, starting above 10", summary(visits_cases_change_model_exc)$coefficients[2,1], summary(visits_cases_change_model_exc)$coefficients[2,4], summary(visits_cases_change_model_exc)$r.squared, as.character(cases_start_date), stringsAsFactors = FALSE)
colnames(cases_change_10) <- c("model_type", "coef_val", "p_val", "r_squared", "cases_start_date")
cases_change_10_log <- data.frame("change in log of cases, starting above 10", summary(visits_cases_change_model_exc_log)$coefficients[2,1], summary(visits_cases_change_model_exc_log)$coefficients[2,4], summary(visits_cases_change_model_exc_log)$r.squared, as.character(cases_start_date), stringsAsFactors = FALSE)
colnames(cases_change_10_log) <- c("model_type", "coef_val", "p_val", "r_squared", "cases_start_date")
return_vals <- rbind(return_vals, cases_change_10, cases_change_10_log)
}
return(return_vals)
}
# pull AC demographic data
zctas_94 <-
zctas(cb = F, starts_with = "94") %>%
st_transform('+proj=longlat +datum=WGS84') %>%
dplyr::select(ZCTA5CE10, geometry)
zctas_95 <-
zctas(cb = F, starts_with = "95") %>%
st_transform('+proj=longlat +datum=WGS84') %>%
dplyr::select(ZCTA5CE10, geometry)
zctas_94_95 <- rbind(zctas_94, zctas_95)
ac_pop_bg <- pullCensus("B01003_001E", ac_fips) %>%
rename(total_pop = B01003_001E)
# average household size
ac_avg_household_size <- pullCensus("B25010_001E", ac_fips) %>%
filter(B25010_001E > 0) %>%
left_join(ac_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
left_join(ac_pop_bg) %>%
group_by(zipcode) %>%
summarize(avg_household_size = weighted.mean(B25010_001E, total_pop)) %>%
filter(!is.na(zipcode))
# occupants per room
ac_occupants_zip <- pullCensus("group(B25014)", ac_fips) %>%
dplyr::select(-c(contains("EA"),contains("MA"),contains("M"))) %>%
gather(key = "variable", value = "estimate", -blockgroup) %>%
mutate(label = acs_vars$label[match(variable,acs_vars$name)]) %>%
dplyr::select(-variable) %>%
separate(label, into = c(NA, NA, NA,"occupants per room"), sep = "!!") %>%
filter(!is.na(`occupants per room`)) %>%
group_by(blockgroup, `occupants per room`) %>%
summarize(estimate_tot = sum(estimate)) %>%
spread(key = `occupants per room`, value = estimate_tot) %>%
mutate(total_nums = `0.50 or less occupants per room` + `0.51 to 1.00 occupants per room` + `1.01 to 1.50 occupants per room` + `1.51 to 2.00 occupants per room` + `2.01 or more occupants per room`) %>%
left_join(ac_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_nums = sum(total_nums), total_0.5less = sum(`0.50 or less occupants per room`), total_0.5to1 = sum(`0.51 to 1.00 occupants per room`), total_1to1.5 = sum(`1.01 to 1.50 occupants per room`), total_1.5to2 = sum(`1.51 to 2.00 occupants per room`), total_2more = sum(`2.01 or more occupants per room`)) %>%
mutate(`percent more than 1 occupant` = (total_1to1.5 + total_1.5to2 + total_2more) * 100/ total_nums, `percent less than 1 occupant` = (100-`percent more than 1 occupant`), `percent 0.5 or less occupants` = total_0.5less*100/total_nums, `percent more than 0.5 occupants` = (100-`percent 0.5 or less occupants`), `percent more than 2 occupants` = total_2more*100/total_nums)
# population density
ac_pop_density_zip <- ac_cases_zip %>% filter(date == max(date)) %>%
dplyr::select(zipcode, total_pop_zip) %>%
left_join(zctas_94_95, by = c("zipcode" = "ZCTA5CE10")) %>%
st_as_sf() %>%
mutate(zip_area = st_area(.), pop_density = total_pop_zip / zip_area) %>%
filter(!is.na(pop_density))
# bucketed household size
ac_house_size_zip <- pullCensus("group(B11016)", ac_fips) %>%
dplyr::select(-c(contains("EA"),contains("MA"),contains("M"))) %>%
gather(key = "variable", value = "estimate", -blockgroup) %>%
mutate(label = acs_vars$label[match(variable,acs_vars$name)]) %>%
dplyr::select(-variable) %>%
separate(label, into = c(NA, NA, "type", "size"), sep = "!!") %>%
filter(!is.na(type)) %>%
filter(!is.na(size)) %>%
dplyr::select(-type) %>%
group_by(blockgroup, size) %>%
summarize(`total of this size` = sum(estimate)) %>%
spread(key = size, value = `total of this size`) %>%
mutate(total_nums = `1-person household` + `2-person household` + `3-person household` + `4-person household` + `5-person household`+ `6-person household` + `7-or-more person household`) %>%
left_join(ac_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_nums = sum(total_nums), total_1 = sum(`1-person household`), total_2 = sum(`2-person household`), total_3 = sum(`3-person household`), total_4 = sum(`4-person household`), total_5 = sum(`5-person household`), total_6 = sum(`6-person household`), total_7more = sum(`7-or-more person household`)) %>%
mutate(`percent 5 or more` = (total_5 + total_6 + total_7more)* 100/ total_nums, `percent 1 or 2 only` = (total_1 + total_2)*100/total_nums)
# units in structure
ac_units_zip <- pullCensus("group(B25024)", ac_fips) %>% dplyr::select(-c(contains("EA"),contains("MA"),contains("M"))) %>%
gather(key = "variable", value = "estimate", -blockgroup) %>%
mutate(label = acs_vars$label[match(variable,acs_vars$name)]) %>%
dplyr::select(-variable) %>%
separate(label, into = c(NA, NA, "units"), sep = "!!") %>%
filter(!is.na(units)) %>%
spread(key = units, value = estimate) %>%
mutate(total_nums = `1, attached` + `1, detached` + `10 to 19` + `2` + `20 to 49`+ `3 or 4` + `5 to 9`+ `50 or more`+ `Boat, RV, van, etc.`+ `Mobile home`, total_20more = `20 to 49`+`50 or more`, total_10more = `10 to 19` + `20 to 49`+`50 or more`, total_1 = `1, attached` + `1, detached`) %>%
left_join(ac_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_nums = sum(total_nums), total_20more = sum(total_20more), total_10more = sum(total_20more), total_1_only = sum(total_1)) %>%
mutate(`percent 10 or more units` = total_10more*100/total_nums, `percent 20 or more units` = total_20more*100/total_nums, `percent 1 only` = total_1_only*100/total_nums, `percent more than 1 unit` = (100 - `percent 1 only`))
# income
ac_income_zip <- pullCensus("group(B19001)", ac_fips) %>% dplyr::select(-c(contains("EA"),contains("MA"),contains("M"))) %>%
gather(key = "variable", value = "estimate", -blockgroup) %>%
mutate(label = acs_vars$label[match(variable,acs_vars$name)]) %>%
dplyr::select(-variable) %>%
separate(label, into = c(NA, NA, "income"), sep = "!!") %>%
filter(!is.na(income)) %>%
spread(key = income, value = estimate) %>%
mutate(total_nums = `Less than $10,000` + `$10,000 to $14,999` + `$15,000 to $19,999` + `$20,000 to $24,999` + `$25,000 to $29,999` + `$30,000 to $34,999` + `$35,000 to $39,999` + `$40,000 to $44,999` + `$45,000 to $49,999` + `$50,000 to $59,999` + `$60,000 to $74,999` + `$75,000 to $99,999` + `$100,000 to $124,999` + `$125,000 to $149,999` + `$150,000 to $199,999` + `$200,000 or more`, over_75000 = `$75,000 to $99,999` + `$100,000 to $124,999` + `$125,000 to $149,999` + `$150,000 to $199,999` + `$200,000 or more`, over_100000 = `$100,000 to $124,999` + `$125,000 to $149,999` + `$150,000 to $199,999` + `$200,000 or more`, over_125000 = `$125,000 to $149,999` + `$150,000 to $199,999` + `$200,000 or more`) %>%
left_join(ac_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_nums = sum(total_nums), total_over_75000 = sum(over_75000), total_over_100000 = sum(over_100000), total_over_125000 = sum(over_125000)) %>%
mutate(percent_over_75000 = total_over_75000*100 / total_nums,
percent_under_75000 = (100 - percent_over_75000),
percent_over_100000 = total_over_100000*100 / total_nums,
percent_under_100000 = (100 - percent_over_100000),
percent_over_125000 = total_over_125000*100 / total_nums,
percent_under_125000 = (100 - percent_over_125000))
# median age
ac_median_age_zip <- pullCensus("B01002_001E", ac_fips) %>%
rename(median_age = B01002_001E) %>%
filter(median_age > 0) %>% # remove invalid results
left_join(ac_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
left_join(ac_pop_bg) %>%
group_by(zipcode) %>%
summarize(avg_median_age = weighted.mean(median_age, total_pop)) %>%
filter(!is.na(zipcode))
ac_dem_data <- left_join(ac_avg_household_size, ac_pop_density_zip %>% dplyr::select(pop_density, zipcode)) %>%
left_join(ac_occupants_zip %>% dplyr::select(`percent more than 1 occupant`, `percent more than 0.5 occupants`, `percent more than 2 occupants`, zipcode)) %>%
left_join(ac_units_zip %>% dplyr::select(`percent 10 or more units`, `percent more than 1 unit`, zipcode)) %>%
left_join(ac_income_zip %>% dplyr::select(percent_under_75000, percent_under_100000, percent_under_125000, zipcode)) %>%
left_join(ac_median_age_zip) %>%
as.data.frame() %>%
filter(!is.na(zipcode) & !is.na(avg_household_size))
cases_start_date <- as.Date("2020-03-23") # first cases start date to use
visits_lag <- 14 # in days
time_window_length <- 7 # in days
# data frame to store results
model_results_1 <- data.frame(model_type = character(), coef_val = numeric(), p_val = numeric(), r_squared = numeric(), cases_start_date = character(), stringsAsFactors = FALSE)
while(cases_start_date + time_window_length <= max(ac_cases_zip$date)) {
model_results_curr <- testVisitsPrediction(ac_visits_zip, ac_cases_zip, cases_start_date, time_window_length, visits_lag, ac_dem_data, "Alameda")
model_results_1 <- rbind(model_results_1, model_results_curr)
cases_start_date <- cases_start_date + time_window_length # run again with new start date
}
## [1] "Cases start date: 2020-03-23"
## [1] "Visits start date: 2020-03-09"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.068e-04 -7.349e-05 -4.120e-05 6.408e-05 2.498e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.004e-05 8.337e-05 -0.600 0.551
## total_visits_per_capita 1.617e-05 1.086e-05 1.488 0.144
##
## Residual standard error: 0.0001049 on 44 degrees of freedom
## Multiple R-squared: 0.04794, Adjusted R-squared: 0.0263
## F-statistic: 2.215 on 1 and 44 DF, p-value: 0.1438
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.059e-04 -7.592e-05 -2.299e-05 2.735e-05 2.713e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.797e-04 5.828e-04 -0.480 0.634
## total_visits_per_capita 1.157e-05 1.785e-05 0.648 0.521
## percent_under_125000 1.267e-06 2.011e-06 0.630 0.533
## avg_household_size 1.498e-05 1.286e-04 0.116 0.908
## pop_density -8.377e-03 1.044e-02 -0.803 0.427
## `percent more than 1 occupant` 2.932e-06 9.044e-06 0.324 0.748
## `percent more than 1 unit` 2.222e-07 2.220e-06 0.100 0.921
## avg_median_age 3.526e-06 6.358e-06 0.555 0.582
##
## Residual standard error: 0.0001083 on 38 degrees of freedom
## Multiple R-squared: 0.1242, Adjusted R-squared: -0.0371
## F-statistic: 0.77 on 7 and 38 DF, p-value: 0.6158
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.021e-04 -6.955e-05 -3.520e-05 3.221e-05 2.387e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.730e-05 8.915e-05 -0.979 0.3336
## total_visits_per_capita 1.953e-05 1.142e-05 1.711 0.0953 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 9.947e-05 on 38 degrees of freedom
## Multiple R-squared: 0.0715, Adjusted R-squared: 0.04706
## F-statistic: 2.926 on 1 and 38 DF, p-value: 0.09531
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.152e-04 -6.658e-05 -2.446e-05 4.385e-05 2.341e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.324e-04 5.547e-04 -0.960 0.344
## total_visits_per_capita 2.186e-05 1.779e-05 1.229 0.228
## percent_under_125000 1.657e-06 1.898e-06 0.873 0.389
## avg_household_size -3.998e-06 1.219e-04 -0.033 0.974
## pop_density -8.245e-03 1.135e-02 -0.726 0.473
## `percent more than 1 occupant` 7.716e-06 9.511e-06 0.811 0.423
## `percent more than 1 unit` 4.672e-07 2.098e-06 0.223 0.825
## avg_median_age 7.384e-06 6.396e-06 1.154 0.257
##
## Residual standard error: 9.946e-05 on 32 degrees of freedom
## Multiple R-squared: 0.2181, Adjusted R-squared: 0.04712
## F-statistic: 1.275 on 7 and 32 DF, p-value: 0.2935
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.5648 -0.3693 -0.1631 0.3159 1.4305
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.5721 0.4483 -1.276 0.2096
## total_visits_per_capita 0.1172 0.0574 2.042 0.0482 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5002 on 38 degrees of freedom
## Multiple R-squared: 0.09885, Adjusted R-squared: 0.07513
## F-statistic: 4.168 on 1 and 38 DF, p-value: 0.04817
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.69312 -0.33574 -0.08586 0.25185 0.97640
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.981253 2.696788 -1.105 0.277
## total_visits_per_capita 0.116534 0.086481 1.348 0.187
## percent_under_125000 0.005886 0.009228 0.638 0.528
## avg_household_size 0.034057 0.592696 0.057 0.955
## pop_density -31.770826 55.185870 -0.576 0.569
## `percent more than 1 occupant` 0.052922 0.046239 1.145 0.261
## `percent more than 1 unit` 0.002811 0.010199 0.276 0.785
## avg_median_age 0.040399 0.031096 1.299 0.203
##
## Residual standard error: 0.4836 on 32 degrees of freedom
## Multiple R-squared: 0.2907, Adjusted R-squared: 0.1356
## F-statistic: 1.874 on 7 and 32 DF, p-value: 0.1071
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## ALL 1 residuals are 0: no residual degrees of freedom!
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0002004 NA NA NA
## total_visits_per_capita NA NA NA NA
##
## Residual standard error: NaN on 0 degrees of freedom
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## ALL 1 residuals are 0: no residual degrees of freedom!
##
## Coefficients: (7 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0002004 NA NA NA
## total_visits_per_capita NA NA NA NA
## percent_under_125000 NA NA NA NA
## avg_household_size NA NA NA NA
## pop_density NA NA NA NA
## `percent more than 1 occupant` NA NA NA NA
## `percent more than 1 unit` NA NA NA NA
## avg_median_age NA NA NA NA
##
## Residual standard error: NaN on 0 degrees of freedom
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## ALL 1 residuals are 0: no residual degrees of freedom!
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.5878 NA NA NA
## total_visits_per_capita NA NA NA NA
##
## Residual standard error: NaN on 0 degrees of freedom
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## ALL 1 residuals are 0: no residual degrees of freedom!
##
## Coefficients: (7 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.5878 NA NA NA
## total_visits_per_capita NA NA NA NA
## percent_under_125000 NA NA NA NA
## avg_household_size NA NA NA NA
## pop_density NA NA NA NA
## `percent more than 1 occupant` NA NA NA NA
## `percent more than 1 unit` NA NA NA NA
## avg_median_age NA NA NA NA
##
## Residual standard error: NaN on 0 degrees of freedom
##
## [1] "Cases start date: 2020-03-30"
## [1] "Visits start date: 2020-03-16"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.109e-04 -1.207e-04 -3.550e-05 3.002e-05 5.100e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.022e-05 1.265e-04 -0.476 0.6364
## total_visits_per_capita 5.632e-05 2.943e-05 1.914 0.0621 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001725 on 44 degrees of freedom
## Multiple R-squared: 0.07686, Adjusted R-squared: 0.05587
## F-statistic: 3.663 on 1 and 44 DF, p-value: 0.06215
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.975e-04 -9.189e-05 -8.398e-06 8.461e-05 2.862e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.217e-04 7.685e-04 0.158 0.875000
## total_visits_per_capita -3.883e-05 4.084e-05 -0.951 0.347732
## percent_under_125000 7.031e-06 2.687e-06 2.617 0.012666 *
## avg_household_size 1.455e-04 1.655e-04 0.880 0.384611
## pop_density -6.064e-02 1.517e-02 -3.996 0.000285 ***
## `percent more than 1 occupant` -1.278e-05 1.182e-05 -1.080 0.286777
## `percent more than 1 unit` 1.808e-06 2.951e-06 0.613 0.543712
## avg_median_age -1.155e-05 8.540e-06 -1.352 0.184395
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001436 on 38 degrees of freedom
## Multiple R-squared: 0.4473, Adjusted R-squared: 0.3455
## F-statistic: 4.393 on 7 and 38 DF, p-value: 0.00118
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.100e-04 -9.143e-05 -2.046e-05 4.448e-05 4.478e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.213e-04 1.140e-04 -1.942 0.05887 .
## total_visits_per_capita 8.958e-05 2.620e-05 3.419 0.00141 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001455 on 42 degrees of freedom
## Multiple R-squared: 0.2177, Adjusted R-squared: 0.1991
## F-statistic: 11.69 on 1 and 42 DF, p-value: 0.00141
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.657e-04 -9.178e-05 -9.541e-06 4.867e-05 2.885e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.015e-05 7.121e-04 0.113 0.91102
## total_visits_per_capita -9.111e-06 4.016e-05 -0.227 0.82180
## percent_under_125000 5.744e-06 2.568e-06 2.236 0.03162 *
## avg_household_size 6.894e-05 1.554e-04 0.443 0.66008
## pop_density -5.150e-02 1.602e-02 -3.215 0.00275 **
## `percent more than 1 occupant` -3.806e-06 1.131e-05 -0.337 0.73833
## `percent more than 1 unit` 4.344e-07 2.804e-06 0.155 0.87774
## avg_median_age -7.304e-06 8.066e-06 -0.905 0.37125
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001323 on 36 degrees of freedom
## Multiple R-squared: 0.4459, Adjusted R-squared: 0.3381
## F-statistic: 4.138 on 7 and 36 DF, p-value: 0.001978
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.68122 -0.25019 0.05312 0.23317 0.57918
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.72842 0.26327 -2.767 0.00838 **
## total_visits_per_capita 0.29279 0.06054 4.836 1.81e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3362 on 42 degrees of freedom
## Multiple R-squared: 0.3577, Adjusted R-squared: 0.3424
## F-statistic: 23.39 on 1 and 42 DF, p-value: 1.807e-05
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.54049 -0.17483 -0.04517 0.09964 0.61872
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.000e-01 1.696e+00 -0.177 0.86058
## total_visits_per_capita 8.431e-02 9.563e-02 0.882 0.38380
## percent_under_125000 6.194e-03 6.116e-03 1.013 0.31797
## avg_household_size 1.910e-01 3.702e-01 0.516 0.60912
## pop_density -1.082e+02 3.814e+01 -2.838 0.00742 **
## `percent more than 1 occupant` 6.530e-03 2.692e-02 0.243 0.80972
## `percent more than 1 unit` 4.991e-03 6.677e-03 0.747 0.45964
## avg_median_age -1.046e-02 1.921e-02 -0.545 0.58944
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.315 on 36 degrees of freedom
## Multiple R-squared: 0.5166, Adjusted R-squared: 0.4226
## F-statistic: 5.496 on 7 and 36 DF, p-value: 0.0002348
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.322e-04 -9.107e-05 -6.920e-05 1.250e-04 2.313e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.620e-04 4.092e-04 -0.396 0.700
## total_visits_per_capita 9.120e-05 8.628e-05 1.057 0.313
##
## Residual standard error: 0.0001596 on 11 degrees of freedom
## Multiple R-squared: 0.09221, Adjusted R-squared: 0.009682
## F-statistic: 1.117 on 1 and 11 DF, p-value: 0.3132
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## 1 2 3 4 5 6 7
## -9.146e-05 -3.054e-05 6.911e-05 -1.390e-05 1.458e-04 -8.110e-05 -1.775e-06
## 8 9 10 11 12 13
## -3.132e-05 -2.450e-06 -4.450e-05 1.558e-04 -4.655e-05 -2.706e-05
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.527e-03 2.689e-03 -2.055 0.0950 .
## total_visits_per_capita 9.561e-05 1.368e-04 0.699 0.5157
## percent_under_125000 1.625e-05 5.921e-06 2.745 0.0406 *
## avg_household_size -4.643e-04 6.770e-04 -0.686 0.5234
## pop_density -1.673e-01 1.216e-01 -1.376 0.2271
## `percent more than 1 occupant` 1.023e-04 8.416e-05 1.215 0.2785
## `percent more than 1 unit` -7.183e-07 1.259e-05 -0.057 0.9567
## avg_median_age 1.316e-04 7.237e-05 1.818 0.1287
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001202 on 5 degrees of freedom
## Multiple R-squared: 0.766, Adjusted R-squared: 0.4384
## F-statistic: 2.338 on 7 and 5 DF, p-value: 0.1834
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.33915 -0.17259 -0.05682 0.15421 0.39574
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.4547 0.6062 -0.750 0.469
## total_visits_per_capita 0.2247 0.1278 1.758 0.107
##
## Residual standard error: 0.2364 on 11 degrees of freedom
## Multiple R-squared: 0.2193, Adjusted R-squared: 0.1484
## F-statistic: 3.09 on 1 and 11 DF, p-value: 0.1065
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## 1 2 3 4 5 6 7 8
## -0.10466 -0.10402 0.03989 -0.04984 0.32826 -0.05850 0.03969 -0.20406
## 9 10 11 12 13
## 0.06758 0.02129 0.21454 -0.15994 -0.03024
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.237e+00 5.080e+00 -1.621 0.166
## total_visits_per_capita 2.015e-01 2.584e-01 0.780 0.471
## percent_under_125000 2.062e-02 1.119e-02 1.843 0.125
## avg_household_size -6.399e-02 1.279e+00 -0.050 0.962
## pop_density -1.479e+02 2.296e+02 -0.644 0.548
## `percent more than 1 occupant` 8.043e-02 1.590e-01 0.506 0.634
## `percent more than 1 unit` 5.089e-03 2.379e-02 0.214 0.839
## avg_median_age 1.575e-01 1.367e-01 1.152 0.301
##
## Residual standard error: 0.2271 on 5 degrees of freedom
## Multiple R-squared: 0.6726, Adjusted R-squared: 0.2143
## F-statistic: 1.468 on 7 and 5 DF, p-value: 0.3477
##
## [1] "Cases start date: 2020-04-06"
## [1] "Visits start date: 2020-03-23"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.913e-04 -1.046e-04 -4.534e-05 1.032e-04 3.594e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.827e-04 1.040e-04 -1.756 0.08602 .
## total_visits_per_capita 7.607e-05 2.351e-05 3.235 0.00231 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001413 on 44 degrees of freedom
## Multiple R-squared: 0.1922, Adjusted R-squared: 0.1738
## F-statistic: 10.47 on 1 and 44 DF, p-value: 0.00231
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.241e-04 -8.057e-05 -2.549e-05 6.255e-05 3.352e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.026e-04 6.831e-04 -0.150 0.8814
## total_visits_per_capita 1.302e-05 3.404e-05 0.383 0.7041
## percent_under_125000 5.750e-06 2.322e-06 2.476 0.0178 *
## avg_household_size 5.565e-05 1.450e-04 0.384 0.7032
## pop_density -2.268e-02 1.314e-02 -1.726 0.0925 .
## `percent more than 1 occupant` -1.585e-06 1.051e-05 -0.151 0.8810
## `percent more than 1 unit` -1.112e-06 2.621e-06 -0.424 0.6737
## avg_median_age -5.356e-06 7.873e-06 -0.680 0.5005
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001266 on 38 degrees of freedom
## Multiple R-squared: 0.4403, Adjusted R-squared: 0.3372
## F-statistic: 4.271 on 7 and 38 DF, p-value: 0.001446
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.913e-04 -1.046e-04 -4.534e-05 1.032e-04 3.594e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.827e-04 1.040e-04 -1.756 0.08602 .
## total_visits_per_capita 7.607e-05 2.351e-05 3.235 0.00231 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001413 on 44 degrees of freedom
## Multiple R-squared: 0.1922, Adjusted R-squared: 0.1738
## F-statistic: 10.47 on 1 and 44 DF, p-value: 0.00231
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.241e-04 -8.057e-05 -2.549e-05 6.255e-05 3.352e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.026e-04 6.831e-04 -0.150 0.8814
## total_visits_per_capita 1.302e-05 3.404e-05 0.383 0.7041
## percent_under_125000 5.750e-06 2.322e-06 2.476 0.0178 *
## avg_household_size 5.565e-05 1.450e-04 0.384 0.7032
## pop_density -2.268e-02 1.314e-02 -1.726 0.0925 .
## `percent more than 1 occupant` -1.585e-06 1.051e-05 -0.151 0.8810
## `percent more than 1 unit` -1.112e-06 2.621e-06 -0.424 0.6737
## avg_median_age -5.356e-06 7.873e-06 -0.680 0.5005
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001266 on 38 degrees of freedom
## Multiple R-squared: 0.4403, Adjusted R-squared: 0.3372
## F-statistic: 4.271 on 7 and 38 DF, p-value: 0.001446
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.33233 -0.19322 -0.08256 0.13873 0.77624
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.34256 0.20614 -1.662 0.10367
## total_visits_per_capita 0.14748 0.04659 3.166 0.00281 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2799 on 44 degrees of freedom
## Multiple R-squared: 0.1855, Adjusted R-squared: 0.167
## F-statistic: 10.02 on 1 and 44 DF, p-value: 0.002806
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.36865 -0.19135 -0.04087 0.09633 0.76207
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.943228 1.509189 -1.288 0.206
## total_visits_per_capita 0.087066 0.075198 1.158 0.254
## percent_under_125000 0.005283 0.005129 1.030 0.310
## avg_household_size 0.391323 0.320292 1.222 0.229
## pop_density 3.702724 29.028637 0.128 0.899
## `percent more than 1 occupant` -0.014654 0.023224 -0.631 0.532
## `percent more than 1 unit` 0.004819 0.005790 0.832 0.410
## avg_median_age 0.008619 0.017395 0.495 0.623
##
## Residual standard error: 0.2796 on 38 degrees of freedom
## Multiple R-squared: 0.2983, Adjusted R-squared: 0.169
## F-statistic: 2.308 on 7 and 38 DF, p-value: 0.04602
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.925e-04 -1.185e-04 -4.579e-05 1.155e-04 3.563e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.356e-05 2.323e-04 -0.058 0.954
## total_visits_per_capita 4.481e-05 4.855e-05 0.923 0.364
##
## Residual standard error: 0.0001533 on 28 degrees of freedom
## Multiple R-squared: 0.02953, Adjusted R-squared: -0.00513
## F-statistic: 0.852 on 1 and 28 DF, p-value: 0.3639
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.870e-04 -7.465e-05 -1.602e-05 5.033e-05 3.064e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.558e-04 8.721e-04 0.981 0.3371
## total_visits_per_capita -2.150e-05 5.288e-05 -0.407 0.6882
## percent_under_125000 5.366e-06 2.755e-06 1.948 0.0643 .
## avg_household_size -8.693e-06 2.216e-04 -0.039 0.9691
## pop_density -4.095e-02 2.396e-02 -1.709 0.1015
## `percent more than 1 occupant` 1.646e-07 1.765e-05 0.009 0.9926
## `percent more than 1 unit` -1.829e-06 3.555e-06 -0.514 0.6120
## avg_median_age -1.896e-05 1.115e-05 -1.700 0.1031
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001288 on 22 degrees of freedom
## Multiple R-squared: 0.4617, Adjusted R-squared: 0.2904
## F-statistic: 2.695 on 7 and 22 DF, p-value: 0.03541
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.34597 -0.18974 -0.05812 0.12537 0.52224
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.34530 0.38121 -0.906 0.3728
## total_visits_per_capita 0.15077 0.07965 1.893 0.0688 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2515 on 28 degrees of freedom
## Multiple R-squared: 0.1134, Adjusted R-squared: 0.08178
## F-statistic: 3.583 on 1 and 28 DF, p-value: 0.06875
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.26653 -0.17445 -0.00980 0.08331 0.59507
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.375788 1.700943 0.809 0.427
## total_visits_per_capita 0.064373 0.103136 0.624 0.539
## percent_under_125000 0.001274 0.005373 0.237 0.815
## avg_household_size -0.115079 0.432200 -0.266 0.793
## pop_density -24.002901 46.739356 -0.514 0.613
## `percent more than 1 occupant` 0.014368 0.034419 0.417 0.680
## `percent more than 1 unit` -0.002373 0.006935 -0.342 0.735
## avg_median_age -0.027107 0.021752 -1.246 0.226
##
## Residual standard error: 0.2512 on 22 degrees of freedom
## Multiple R-squared: 0.3051, Adjusted R-squared: 0.08394
## F-statistic: 1.38 on 7 and 22 DF, p-value: 0.2628
##
## [1] "Cases start date: 2020-04-13"
## [1] "Visits start date: 2020-03-30"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.577e-04 -1.317e-04 -5.181e-05 5.600e-05 1.161e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.892e-04 1.388e-04 -1.363 0.1797
## total_visits_per_capita 8.605e-05 3.267e-05 2.634 0.0116 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002303 on 44 degrees of freedom
## Multiple R-squared: 0.1362, Adjusted R-squared: 0.1166
## F-statistic: 6.938 on 1 and 44 DF, p-value: 0.0116
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.973e-04 -1.080e-04 -2.874e-05 4.025e-05 9.933e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.058e-04 1.138e-03 0.532 0.5975
## total_visits_per_capita -1.479e-05 5.614e-05 -0.263 0.7936
## percent_under_125000 8.596e-06 4.057e-06 2.119 0.0407 *
## avg_household_size -2.869e-04 2.430e-04 -1.181 0.2451
## pop_density -2.703e-02 2.377e-02 -1.137 0.2626
## `percent more than 1 occupant` 3.183e-05 1.741e-05 1.828 0.0754 .
## `percent more than 1 unit` -6.925e-06 4.334e-06 -1.598 0.1183
## avg_median_age 3.084e-07 1.277e-05 0.024 0.9809
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002106 on 38 degrees of freedom
## Multiple R-squared: 0.3759, Adjusted R-squared: 0.261
## F-statistic: 3.27 on 7 and 38 DF, p-value: 0.008103
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.577e-04 -1.317e-04 -5.181e-05 5.600e-05 1.161e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.892e-04 1.388e-04 -1.363 0.1797
## total_visits_per_capita 8.605e-05 3.267e-05 2.634 0.0116 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002303 on 44 degrees of freedom
## Multiple R-squared: 0.1362, Adjusted R-squared: 0.1166
## F-statistic: 6.938 on 1 and 44 DF, p-value: 0.0116
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.973e-04 -1.080e-04 -2.874e-05 4.025e-05 9.933e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.058e-04 1.138e-03 0.532 0.5975
## total_visits_per_capita -1.479e-05 5.614e-05 -0.263 0.7936
## percent_under_125000 8.596e-06 4.057e-06 2.119 0.0407 *
## avg_household_size -2.869e-04 2.430e-04 -1.181 0.2451
## pop_density -2.703e-02 2.377e-02 -1.137 0.2626
## `percent more than 1 occupant` 3.183e-05 1.741e-05 1.828 0.0754 .
## `percent more than 1 unit` -6.925e-06 4.334e-06 -1.598 0.1183
## avg_median_age 3.084e-07 1.277e-05 0.024 0.9809
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002106 on 38 degrees of freedom
## Multiple R-squared: 0.3759, Adjusted R-squared: 0.261
## F-statistic: 3.27 on 7 and 38 DF, p-value: 0.008103
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.29290 -0.13603 -0.02956 0.06329 0.70589
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.16692 0.13042 -1.280 0.20729
## total_visits_per_capita 0.08855 0.03070 2.884 0.00606 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2164 on 44 degrees of freedom
## Multiple R-squared: 0.159, Adjusted R-squared: 0.1399
## F-statistic: 8.317 on 1 and 44 DF, p-value: 0.006057
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.26307 -0.08973 -0.03162 0.03439 0.64884
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.091380 1.017672 -0.090 0.9289
## total_visits_per_capita 0.036540 0.050214 0.728 0.4713
## percent_under_125000 0.005099 0.003629 1.405 0.1681
## avg_household_size -0.246772 0.217371 -1.135 0.2634
## pop_density 5.122509 21.258546 0.241 0.8109
## `percent more than 1 occupant` 0.035060 0.015574 2.251 0.0302 *
## `percent more than 1 unit` -0.003794 0.003876 -0.979 0.3339
## avg_median_age 0.010457 0.011426 0.915 0.3659
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1884 on 38 degrees of freedom
## Multiple R-squared: 0.4497, Adjusted R-squared: 0.3483
## F-statistic: 4.435 on 7 and 38 DF, p-value: 0.001101
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.895e-04 -1.338e-04 -4.668e-05 3.076e-05 1.157e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.831e-04 3.218e-04 -0.880 0.386
## total_visits_per_capita 1.103e-04 6.997e-05 1.576 0.125
##
## Residual standard error: 0.0002584 on 31 degrees of freedom
## Multiple R-squared: 0.07415, Adjusted R-squared: 0.04429
## F-statistic: 2.483 on 1 and 31 DF, p-value: 0.1252
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.223e-04 -1.166e-04 -3.753e-05 3.165e-05 8.624e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.544e-04 1.447e-03 0.659 0.5156
## total_visits_per_capita -6.964e-05 1.089e-04 -0.639 0.5283
## percent_under_125000 1.005e-05 4.913e-06 2.047 0.0514 .
## avg_household_size -4.046e-04 3.494e-04 -1.158 0.2577
## pop_density -4.579e-02 3.612e-02 -1.268 0.2166
## `percent more than 1 occupant` 4.214e-05 2.615e-05 1.612 0.1196
## `percent more than 1 unit` -1.022e-05 5.991e-06 -1.706 0.1003
## avg_median_age 6.849e-06 1.831e-05 0.374 0.7115
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002389 on 25 degrees of freedom
## Multiple R-squared: 0.3615, Adjusted R-squared: 0.1827
## F-statistic: 2.022 on 7 and 25 DF, p-value: 0.09222
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.32570 -0.12637 -0.03891 0.04850 0.70407
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.27536 0.26028 -1.058 0.2983
## total_visits_per_capita 0.11574 0.05659 2.045 0.0494 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.209 on 31 degrees of freedom
## Multiple R-squared: 0.1189, Adjusted R-squared: 0.09048
## F-statistic: 4.184 on 1 and 31 DF, p-value: 0.04939
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.23917 -0.08182 -0.03794 0.03267 0.56558
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.284805 1.149357 0.248 0.806
## total_visits_per_capita -0.008769 0.086492 -0.101 0.920
## percent_under_125000 0.006361 0.003902 1.630 0.116
## avg_household_size -0.265916 0.277491 -0.958 0.347
## pop_density -0.740556 28.687991 -0.026 0.980
## `percent more than 1 occupant` 0.034742 0.020765 1.673 0.107
## `percent more than 1 unit` -0.007158 0.004758 -1.504 0.145
## avg_median_age 0.009394 0.014541 0.646 0.524
##
## Residual standard error: 0.1898 on 25 degrees of freedom
## Multiple R-squared: 0.4139, Adjusted R-squared: 0.2498
## F-statistic: 2.522 on 7 and 25 DF, p-value: 0.04153
##
## [1] "Cases start date: 2020-04-20"
## [1] "Visits start date: 2020-04-06"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.754e-04 -1.115e-04 -3.454e-05 2.709e-05 1.113e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.353e-04 1.301e-04 -1.040 0.304
## total_visits_per_capita 6.940e-05 3.296e-05 2.105 0.041 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002055 on 44 degrees of freedom
## Multiple R-squared: 0.09152, Adjusted R-squared: 0.07087
## F-statistic: 4.433 on 1 and 44 DF, p-value: 0.041
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.905e-04 -7.521e-05 -3.391e-05 4.995e-05 9.173e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.524e-03 1.008e-03 1.512 0.1388
## total_visits_per_capita 1.784e-05 4.802e-05 0.371 0.7124
## percent_under_125000 6.577e-06 3.437e-06 1.914 0.0632 .
## avg_household_size -4.260e-04 2.195e-04 -1.941 0.0597 .
## pop_density -3.528e-02 1.987e-02 -1.776 0.0838 .
## `percent more than 1 occupant` 2.785e-05 1.539e-05 1.810 0.0782 .
## `percent more than 1 unit` -7.615e-06 3.888e-06 -1.958 0.0575 .
## avg_median_age -1.223e-05 1.108e-05 -1.104 0.2766
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001872 on 38 degrees of freedom
## Multiple R-squared: 0.3489, Adjusted R-squared: 0.2289
## F-statistic: 2.908 on 7 and 38 DF, p-value: 0.01546
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.754e-04 -1.115e-04 -3.454e-05 2.709e-05 1.113e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.353e-04 1.301e-04 -1.040 0.304
## total_visits_per_capita 6.940e-05 3.296e-05 2.105 0.041 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002055 on 44 degrees of freedom
## Multiple R-squared: 0.09152, Adjusted R-squared: 0.07087
## F-statistic: 4.433 on 1 and 44 DF, p-value: 0.041
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.905e-04 -7.521e-05 -3.391e-05 4.995e-05 9.173e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.524e-03 1.008e-03 1.512 0.1388
## total_visits_per_capita 1.784e-05 4.802e-05 0.371 0.7124
## percent_under_125000 6.577e-06 3.437e-06 1.914 0.0632 .
## avg_household_size -4.260e-04 2.195e-04 -1.941 0.0597 .
## pop_density -3.528e-02 1.987e-02 -1.776 0.0838 .
## `percent more than 1 occupant` 2.785e-05 1.539e-05 1.810 0.0782 .
## `percent more than 1 unit` -7.615e-06 3.888e-06 -1.958 0.0575 .
## avg_median_age -1.223e-05 1.108e-05 -1.104 0.2766
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001872 on 38 degrees of freedom
## Multiple R-squared: 0.3489, Adjusted R-squared: 0.2289
## F-statistic: 2.908 on 7 and 38 DF, p-value: 0.01546
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.14030 -0.06907 -0.03088 0.04138 0.33001
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.10040 0.06794 -1.478 0.14661
## total_visits_per_capita 0.05644 0.01722 3.278 0.00205 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1073 on 44 degrees of freedom
## Multiple R-squared: 0.1962, Adjusted R-squared: 0.178
## F-statistic: 10.74 on 1 and 44 DF, p-value: 0.002049
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.183701 -0.065891 0.002695 0.032633 0.284958
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.293551 0.538239 0.545 0.5887
## total_visits_per_capita 0.055689 0.025644 2.172 0.0362 *
## percent_under_125000 0.002018 0.001836 1.100 0.2785
## avg_household_size -0.169193 0.117213 -1.443 0.1571
## pop_density -6.199466 10.611418 -0.584 0.5625
## `percent more than 1 occupant` 0.012543 0.008218 1.526 0.1352
## `percent more than 1 unit` -0.001476 0.002077 -0.711 0.4814
## avg_median_age -0.001371 0.005917 -0.232 0.8180
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.09996 on 38 degrees of freedom
## Multiple R-squared: 0.3977, Adjusted R-squared: 0.2868
## F-statistic: 3.585 on 7 and 38 DF, p-value: 0.004658
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.788e-04 -1.261e-04 -7.176e-05 3.339e-05 1.078e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.197e-05 2.979e-04 0.074 0.942
## total_visits_per_capita 3.685e-05 7.000e-05 0.526 0.602
##
## Residual standard error: 0.0002339 on 32 degrees of freedom
## Multiple R-squared: 0.008585, Adjusted R-squared: -0.0224
## F-statistic: 0.2771 on 1 and 32 DF, p-value: 0.6022
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.854e-04 -1.174e-04 -5.299e-05 5.336e-05 8.040e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.943e-03 1.270e-03 1.530 0.1381
## total_visits_per_capita -3.861e-05 1.007e-04 -0.383 0.7045
## percent_under_125000 7.694e-06 4.175e-06 1.843 0.0768 .
## avg_household_size -5.321e-04 3.091e-04 -1.722 0.0970 .
## pop_density -5.345e-02 2.947e-02 -1.814 0.0813 .
## `percent more than 1 occupant` 3.510e-05 2.256e-05 1.556 0.1319
## `percent more than 1 unit` -9.259e-06 5.333e-06 -1.736 0.0944 .
## avg_median_age -9.061e-06 1.631e-05 -0.556 0.5833
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002123 on 26 degrees of freedom
## Multiple R-squared: 0.3365, Adjusted R-squared: 0.1578
## F-statistic: 1.884 on 7 and 26 DF, p-value: 0.1135
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.15772 -0.06566 -0.01973 0.06574 0.29150
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.09393 0.14396 0.652 0.519
## total_visits_per_capita 0.01500 0.03383 0.443 0.661
##
## Residual standard error: 0.113 on 32 degrees of freedom
## Multiple R-squared: 0.006103, Adjusted R-squared: -0.02496
## F-statistic: 0.1965 on 1 and 32 DF, p-value: 0.6606
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.19405 -0.05393 -0.01391 0.03399 0.25158
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.681162 0.645432 1.055 0.301
## total_visits_per_capita 0.027812 0.051153 0.544 0.591
## percent_under_125000 0.002213 0.002121 1.043 0.306
## avg_household_size -0.177948 0.157052 -1.133 0.268
## pop_density -6.994159 14.973481 -0.467 0.644
## `percent more than 1 occupant` 0.009237 0.011462 0.806 0.428
## `percent more than 1 unit` -0.001809 0.002710 -0.668 0.510
## avg_median_age -0.006590 0.008287 -0.795 0.434
##
## Residual standard error: 0.1079 on 26 degrees of freedom
## Multiple R-squared: 0.2649, Adjusted R-squared: 0.06695
## F-statistic: 1.338 on 7 and 26 DF, p-value: 0.2726
##
## [1] "Cases start date: 2020-04-27"
## [1] "Visits start date: 2020-04-13"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.777e-04 -9.729e-05 -5.981e-05 5.238e-05 4.977e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.854e-04 9.983e-05 -1.857 0.07004 .
## total_visits_per_capita 7.119e-05 2.183e-05 3.261 0.00215 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001575 on 44 degrees of freedom
## Multiple R-squared: 0.1947, Adjusted R-squared: 0.1764
## F-statistic: 10.64 on 1 and 44 DF, p-value: 0.002147
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.062e-04 -8.515e-05 -1.882e-05 4.073e-05 2.762e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.779e-04 6.844e-04 -0.552 0.584
## total_visits_per_capita 1.113e-05 2.895e-05 0.384 0.703
## percent_under_125000 2.720e-06 2.443e-06 1.114 0.272
## avg_household_size -6.039e-05 1.469e-04 -0.411 0.683
## pop_density 1.003e-03 1.352e-02 0.074 0.941
## `percent more than 1 occupant` 2.624e-05 1.041e-05 2.522 0.016 *
## `percent more than 1 unit` -9.665e-07 2.614e-06 -0.370 0.714
## avg_median_age 8.080e-06 7.575e-06 1.067 0.293
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001266 on 38 degrees of freedom
## Multiple R-squared: 0.5507, Adjusted R-squared: 0.468
## F-statistic: 6.655 on 7 and 38 DF, p-value: 3.671e-05
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.777e-04 -9.729e-05 -5.981e-05 5.238e-05 4.977e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.854e-04 9.983e-05 -1.857 0.07004 .
## total_visits_per_capita 7.119e-05 2.183e-05 3.261 0.00215 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001575 on 44 degrees of freedom
## Multiple R-squared: 0.1947, Adjusted R-squared: 0.1764
## F-statistic: 10.64 on 1 and 44 DF, p-value: 0.002147
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.062e-04 -8.515e-05 -1.882e-05 4.073e-05 2.762e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.779e-04 6.844e-04 -0.552 0.584
## total_visits_per_capita 1.113e-05 2.895e-05 0.384 0.703
## percent_under_125000 2.720e-06 2.443e-06 1.114 0.272
## avg_household_size -6.039e-05 1.469e-04 -0.411 0.683
## pop_density 1.003e-03 1.352e-02 0.074 0.941
## `percent more than 1 occupant` 2.624e-05 1.041e-05 2.522 0.016 *
## `percent more than 1 unit` -9.665e-07 2.614e-06 -0.370 0.714
## avg_median_age 8.080e-06 7.575e-06 1.067 0.293
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001266 on 38 degrees of freedom
## Multiple R-squared: 0.5507, Adjusted R-squared: 0.468
## F-statistic: 6.655 on 7 and 38 DF, p-value: 3.671e-05
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.16184 -0.08065 -0.04651 0.04044 0.58123
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.06620 0.09888 -0.669 0.5067
## total_visits_per_capita 0.04472 0.02162 2.068 0.0445 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.156 on 44 degrees of freedom
## Multiple R-squared: 0.08861, Adjusted R-squared: 0.06789
## F-statistic: 4.278 on 1 and 44 DF, p-value: 0.04452
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.14174 -0.08094 -0.04972 0.02702 0.60497
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.4586019 0.8748162 -0.524 0.603
## total_visits_per_capita 0.0509959 0.0370091 1.378 0.176
## percent_under_125000 0.0005486 0.0031226 0.176 0.861
## avg_household_size -0.0028093 0.1877740 -0.015 0.988
## pop_density 18.2005460 17.2795584 1.053 0.299
## `percent more than 1 occupant` 0.0044301 0.0133009 0.333 0.741
## `percent more than 1 unit` 0.0000646 0.0033414 0.019 0.985
## avg_median_age 0.0065847 0.0096837 0.680 0.501
##
## Residual standard error: 0.1618 on 38 degrees of freedom
## Multiple R-squared: 0.1531, Adjusted R-squared: -0.002888
## F-statistic: 0.9815 on 7 and 38 DF, p-value: 0.4589
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.832e-04 -1.088e-04 -6.531e-05 6.538e-05 4.868e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.447e-04 2.273e-04 -1.516 0.1392
## total_visits_per_capita 1.035e-04 4.613e-05 2.244 0.0319 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001729 on 32 degrees of freedom
## Multiple R-squared: 0.136, Adjusted R-squared: 0.109
## F-statistic: 5.036 on 1 and 32 DF, p-value: 0.03188
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.172e-04 -8.677e-05 7.818e-06 6.038e-05 2.855e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.723e-04 7.579e-04 -0.491 0.627
## total_visits_per_capita 2.299e-06 5.190e-05 0.044 0.965
## percent_under_125000 2.543e-06 2.535e-06 1.003 0.325
## avg_household_size 2.694e-05 1.716e-04 0.157 0.876
## pop_density -3.575e-03 1.739e-02 -0.206 0.839
## `percent more than 1 occupant` 2.136e-05 1.332e-05 1.604 0.121
## `percent more than 1 unit` 1.414e-06 3.140e-06 0.450 0.656
## avg_median_age 1.514e-06 9.555e-06 0.158 0.875
##
## Residual standard error: 0.0001249 on 26 degrees of freedom
## Multiple R-squared: 0.6336, Adjusted R-squared: 0.5349
## F-statistic: 6.422 on 7 and 26 DF, p-value: 0.0001908
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.14786 -0.06316 -0.03267 0.06739 0.25531
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.06832 0.13633 -0.501 0.620
## total_visits_per_capita 0.04239 0.02767 1.532 0.135
##
## Residual standard error: 0.1037 on 32 degrees of freedom
## Multiple R-squared: 0.06834, Adjusted R-squared: 0.03923
## F-statistic: 2.347 on 1 and 32 DF, p-value: 0.1353
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.108159 -0.054392 -0.008662 0.034373 0.231112
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.3370771 0.5057060 -0.667 0.511
## total_visits_per_capita 0.0369093 0.0346346 1.066 0.296
## percent_under_125000 -0.0004162 0.0016915 -0.246 0.808
## avg_household_size 0.0684040 0.1144946 0.597 0.555
## pop_density 8.5383626 11.6049447 0.736 0.468
## `percent more than 1 occupant` 0.0037451 0.0088894 0.421 0.677
## `percent more than 1 unit` 0.0030470 0.0020954 1.454 0.158
## avg_median_age -0.0011763 0.0063760 -0.184 0.855
##
## Residual standard error: 0.08336 on 26 degrees of freedom
## Multiple R-squared: 0.511, Adjusted R-squared: 0.3794
## F-statistic: 3.881 on 7 and 26 DF, p-value: 0.005082
##
## [1] "Cases start date: 2020-05-04"
## [1] "Visits start date: 2020-04-20"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.234e-04 -1.354e-04 -2.627e-05 7.060e-05 7.530e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.173e-04 1.217e-04 -1.786 0.08105 .
## total_visits_per_capita 8.577e-05 2.766e-05 3.100 0.00337 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001901 on 44 degrees of freedom
## Multiple R-squared: 0.1793, Adjusted R-squared: 0.1606
## F-statistic: 9.613 on 1 and 44 DF, p-value: 0.003366
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.816e-04 -6.621e-05 -8.290e-06 6.271e-05 3.642e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.395e-04 7.180e-04 -0.334 0.74052
## total_visits_per_capita 2.455e-05 3.141e-05 0.781 0.43937
## percent_under_125000 3.241e-06 2.581e-06 1.256 0.21688
## avg_household_size -1.107e-04 1.538e-04 -0.720 0.47594
## pop_density 8.086e-03 1.478e-02 0.547 0.58761
## `percent more than 1 occupant` 3.332e-05 1.103e-05 3.022 0.00448 **
## `percent more than 1 unit` -2.096e-06 2.759e-06 -0.760 0.45215
## avg_median_age 5.752e-06 7.895e-06 0.729 0.47069
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001341 on 38 degrees of freedom
## Multiple R-squared: 0.6473, Adjusted R-squared: 0.5823
## F-statistic: 9.961 on 7 and 38 DF, p-value: 5.366e-07
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.234e-04 -1.354e-04 -2.627e-05 7.060e-05 7.530e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.173e-04 1.217e-04 -1.786 0.08105 .
## total_visits_per_capita 8.577e-05 2.766e-05 3.100 0.00337 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001901 on 44 degrees of freedom
## Multiple R-squared: 0.1793, Adjusted R-squared: 0.1606
## F-statistic: 9.613 on 1 and 44 DF, p-value: 0.003366
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.816e-04 -6.621e-05 -8.290e-06 6.271e-05 3.642e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.395e-04 7.180e-04 -0.334 0.74052
## total_visits_per_capita 2.455e-05 3.141e-05 0.781 0.43937
## percent_under_125000 3.241e-06 2.581e-06 1.256 0.21688
## avg_household_size -1.107e-04 1.538e-04 -0.720 0.47594
## pop_density 8.086e-03 1.478e-02 0.547 0.58761
## `percent more than 1 occupant` 3.332e-05 1.103e-05 3.022 0.00448 **
## `percent more than 1 unit` -2.096e-06 2.759e-06 -0.760 0.45215
## avg_median_age 5.752e-06 7.895e-06 0.729 0.47069
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001341 on 38 degrees of freedom
## Multiple R-squared: 0.6473, Adjusted R-squared: 0.5823
## F-statistic: 9.961 on 7 and 38 DF, p-value: 5.366e-07
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.13883 -0.07078 -0.03067 0.06819 0.31000
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.06436 0.06730 -0.956 0.3441
## total_visits_per_capita 0.03954 0.01530 2.584 0.0131 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1051 on 44 degrees of freedom
## Multiple R-squared: 0.1318, Adjusted R-squared: 0.1121
## F-statistic: 6.679 on 1 and 44 DF, p-value: 0.01315
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.167072 -0.062398 -0.000402 0.056712 0.184413
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.4499323 0.4622858 -0.973 0.3366
## total_visits_per_capita 0.0396685 0.0202261 1.961 0.0572 .
## percent_under_125000 0.0015049 0.0016616 0.906 0.3708
## avg_household_size -0.0255094 0.0990267 -0.258 0.7981
## pop_density 15.1946591 9.5192907 1.596 0.1187
## `percent more than 1 occupant` 0.0093394 0.0070993 1.316 0.1962
## `percent more than 1 unit` 0.0003421 0.0017766 0.193 0.8483
## avg_median_age 0.0062869 0.0050832 1.237 0.2238
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.08635 on 38 degrees of freedom
## Multiple R-squared: 0.4943, Adjusted R-squared: 0.4011
## F-statistic: 5.305 on 7 and 38 DF, p-value: 0.0002728
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.418e-04 -1.590e-04 -4.129e-05 8.282e-05 7.354e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.993e-04 2.679e-04 -1.117 0.2717
## total_visits_per_capita 1.053e-04 5.699e-05 1.848 0.0733 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.00021 on 34 degrees of freedom
## Multiple R-squared: 0.09127, Adjusted R-squared: 0.06454
## F-statistic: 3.415 on 1 and 34 DF, p-value: 0.07332
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.501e-04 -8.439e-05 -2.580e-06 8.662e-05 3.528e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.985e-05 8.332e-04 -0.084 0.934
## total_visits_per_capita -1.066e-05 6.308e-05 -0.169 0.867
## percent_under_125000 3.393e-06 2.904e-06 1.168 0.253
## avg_household_size 8.186e-05 1.914e-04 0.428 0.672
## pop_density 1.659e-02 2.075e-02 0.800 0.431
## `percent more than 1 occupant` 1.598e-05 1.468e-05 1.088 0.286
## `percent more than 1 unit` 3.430e-07 3.385e-06 0.101 0.920
## avg_median_age -8.381e-06 1.050e-05 -0.798 0.432
##
## Residual standard error: 0.0001389 on 28 degrees of freedom
## Multiple R-squared: 0.6726, Adjusted R-squared: 0.5907
## F-statistic: 8.216 on 7 and 28 DF, p-value: 1.938e-05
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.13520 -0.08548 -0.02324 0.07209 0.29357
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.122556 0.141673 0.865 0.393
## total_visits_per_capita 0.002461 0.030140 0.082 0.935
##
## Residual standard error: 0.1111 on 34 degrees of freedom
## Multiple R-squared: 0.0001961, Adjusted R-squared: -0.02921
## F-statistic: 0.006668 on 1 and 34 DF, p-value: 0.9354
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.135913 -0.046925 -0.006487 0.050608 0.154001
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.040993 0.471951 -0.087 0.931
## total_visits_per_capita -0.007623 0.035729 -0.213 0.833
## percent_under_125000 0.001482 0.001645 0.901 0.375
## avg_household_size 0.104080 0.108400 0.960 0.345
## pop_density 22.309896 11.753732 1.898 0.068 .
## `percent more than 1 occupant` -0.003893 0.008316 -0.468 0.643
## `percent more than 1 unit` 0.001626 0.001917 0.848 0.404
## avg_median_age -0.007051 0.005949 -1.185 0.246
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0787 on 28 degrees of freedom
## Multiple R-squared: 0.5868, Adjusted R-squared: 0.4835
## F-statistic: 5.68 on 7 and 28 DF, p-value: 0.000371
##
## [1] "Cases start date: 2020-05-11"
## [1] "Visits start date: 2020-04-27"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.688e-04 -1.328e-04 -5.446e-05 1.974e-05 9.389e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.543e-04 1.456e-04 -1.060 0.2951
## total_visits_per_capita 7.770e-05 3.213e-05 2.418 0.0198 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002322 on 44 degrees of freedom
## Multiple R-squared: 0.1173, Adjusted R-squared: 0.09725
## F-statistic: 5.848 on 1 and 44 DF, p-value: 0.01981
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.278e-04 -7.492e-05 -2.659e-05 5.980e-05 4.945e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.188e-06 9.106e-04 0.002 0.9981
## total_visits_per_capita -1.419e-05 4.138e-05 -0.343 0.7336
## percent_under_125000 7.189e-06 3.346e-06 2.149 0.0381 *
## avg_household_size -1.296e-04 1.972e-04 -0.657 0.5151
## pop_density 8.167e-03 1.824e-02 0.448 0.6568
## `percent more than 1 occupant` 3.434e-05 1.396e-05 2.459 0.0186 *
## `percent more than 1 unit` -5.826e-06 3.474e-06 -1.677 0.1018
## avg_median_age 3.342e-06 1.002e-05 0.333 0.7407
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001696 on 38 degrees of freedom
## Multiple R-squared: 0.5934, Adjusted R-squared: 0.5185
## F-statistic: 7.923 on 7 and 38 DF, p-value: 6.533e-06
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.688e-04 -1.328e-04 -5.446e-05 1.974e-05 9.389e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.543e-04 1.456e-04 -1.060 0.2951
## total_visits_per_capita 7.770e-05 3.213e-05 2.418 0.0198 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002322 on 44 degrees of freedom
## Multiple R-squared: 0.1173, Adjusted R-squared: 0.09725
## F-statistic: 5.848 on 1 and 44 DF, p-value: 0.01981
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.278e-04 -7.492e-05 -2.659e-05 5.980e-05 4.945e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.188e-06 9.106e-04 0.002 0.9981
## total_visits_per_capita -1.419e-05 4.138e-05 -0.343 0.7336
## percent_under_125000 7.189e-06 3.346e-06 2.149 0.0381 *
## avg_household_size -1.296e-04 1.972e-04 -0.657 0.5151
## pop_density 8.167e-03 1.824e-02 0.448 0.6568
## `percent more than 1 occupant` 3.434e-05 1.396e-05 2.459 0.0186 *
## `percent more than 1 unit` -5.826e-06 3.474e-06 -1.677 0.1018
## avg_median_age 3.342e-06 1.002e-05 0.333 0.7407
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001696 on 38 degrees of freedom
## Multiple R-squared: 0.5934, Adjusted R-squared: 0.5185
## F-statistic: 7.923 on 7 and 38 DF, p-value: 6.533e-06
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.13081 -0.12273 -0.02104 0.03082 0.57290
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.116292 0.090317 1.288 0.205
## total_visits_per_capita 0.002666 0.019936 0.134 0.894
##
## Residual standard error: 0.144 on 44 degrees of freedom
## Multiple R-squared: 0.0004063, Adjusted R-squared: -0.02231
## F-statistic: 0.01788 on 1 and 44 DF, p-value: 0.8942
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.24390 -0.06740 -0.01165 0.05249 0.38090
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.3698750 0.6500454 -0.569 0.5727
## total_visits_per_capita -0.0135994 0.0295407 -0.460 0.6479
## percent_under_125000 0.0024671 0.0023886 1.033 0.3082
## avg_household_size 0.1373459 0.1407586 0.976 0.3354
## pop_density 26.7210378 13.0195506 2.052 0.0471 *
## `percent more than 1 occupant` -0.0021146 0.0099680 -0.212 0.8331
## `percent more than 1 unit` -0.0003188 0.0024804 -0.129 0.8984
## avg_median_age -0.0007490 0.0071560 -0.105 0.9172
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.121 on 38 degrees of freedom
## Multiple R-squared: 0.3903, Adjusted R-squared: 0.278
## F-statistic: 3.476 on 7 and 38 DF, p-value: 0.005639
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.839e-04 -1.506e-04 -7.022e-05 1.672e-05 9.208e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.101e-04 2.815e-04 -0.391 0.698
## total_visits_per_capita 7.238e-05 5.827e-05 1.242 0.223
##
## Residual standard error: 0.0002536 on 34 degrees of freedom
## Multiple R-squared: 0.04341, Adjusted R-squared: 0.01528
## F-statistic: 1.543 on 1 and 34 DF, p-value: 0.2227
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.069e-04 -9.285e-05 -2.938e-05 8.150e-05 4.897e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.233e-04 1.089e-03 0.481 0.6346
## total_visits_per_capita -1.058e-04 8.391e-05 -1.260 0.2179
## percent_under_125000 8.811e-06 4.210e-06 2.093 0.0456 *
## avg_household_size -6.489e-05 2.596e-04 -0.250 0.8045
## pop_density 8.777e-04 2.915e-02 0.030 0.9762
## `percent more than 1 occupant` 2.915e-05 1.959e-05 1.488 0.1480
## `percent more than 1 unit` -6.561e-06 4.509e-06 -1.455 0.1568
## avg_median_age -3.766e-06 1.389e-05 -0.271 0.7883
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001848 on 28 degrees of freedom
## Multiple R-squared: 0.5819, Adjusted R-squared: 0.4774
## F-statistic: 5.567 on 7 and 28 DF, p-value: 0.0004295
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.15228 -0.06388 -0.01961 0.01988 0.36371
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.08758 0.12539 0.698 0.49
## total_visits_per_capita 0.01188 0.02596 0.458 0.65
##
## Residual standard error: 0.113 on 34 degrees of freedom
## Multiple R-squared: 0.006128, Adjusted R-squared: -0.0231
## F-statistic: 0.2096 on 1 and 34 DF, p-value: 0.65
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.14996 -0.06838 -0.01682 0.05234 0.33198
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.114149 0.629011 -0.181 0.857
## total_visits_per_capita -0.016038 0.048469 -0.331 0.743
## percent_under_125000 0.003213 0.002432 1.321 0.197
## avg_household_size -0.024317 0.149972 -0.162 0.872
## pop_density 13.021820 16.836719 0.773 0.446
## `percent more than 1 occupant` 0.007086 0.011318 0.626 0.536
## `percent more than 1 unit` -0.002342 0.002604 -0.899 0.376
## avg_median_age 0.005146 0.008025 0.641 0.527
##
## Residual standard error: 0.1067 on 28 degrees of freedom
## Multiple R-squared: 0.2696, Adjusted R-squared: 0.08705
## F-statistic: 1.477 on 7 and 28 DF, p-value: 0.2159
##
## [1] "Cases start date: 2020-05-18"
## [1] "Visits start date: 2020-05-04"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.406e-04 -1.961e-04 -9.740e-05 4.548e-05 1.919e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.912e-05 2.290e-04 -0.433 0.667
## total_visits_per_capita 7.991e-05 5.313e-05 1.504 0.140
##
## Residual standard error: 0.0003713 on 44 degrees of freedom
## Multiple R-squared: 0.0489, Adjusted R-squared: 0.02728
## F-statistic: 2.262 on 1 and 44 DF, p-value: 0.1397
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.618e-04 -1.329e-04 -1.758e-05 8.452e-05 1.184e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.351e-04 1.487e-03 0.091 0.9281
## total_visits_per_capita -3.900e-05 6.693e-05 -0.583 0.5635
## percent_under_125000 9.110e-06 5.177e-06 1.760 0.0865 .
## avg_household_size -2.339e-04 3.352e-04 -0.698 0.4895
## pop_density 1.571e-02 2.980e-02 0.527 0.6013
## `percent more than 1 occupant` 5.828e-05 2.319e-05 2.513 0.0163 *
## `percent more than 1 unit` -8.804e-06 5.728e-06 -1.537 0.1326
## avg_median_age 6.403e-06 1.615e-05 0.397 0.6939
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002768 on 38 degrees of freedom
## Multiple R-squared: 0.5436, Adjusted R-squared: 0.4595
## F-statistic: 6.466 on 7 and 38 DF, p-value: 4.806e-05
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.406e-04 -1.961e-04 -9.740e-05 4.548e-05 1.919e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.912e-05 2.290e-04 -0.433 0.667
## total_visits_per_capita 7.991e-05 5.313e-05 1.504 0.140
##
## Residual standard error: 0.0003713 on 44 degrees of freedom
## Multiple R-squared: 0.0489, Adjusted R-squared: 0.02728
## F-statistic: 2.262 on 1 and 44 DF, p-value: 0.1397
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.618e-04 -1.329e-04 -1.758e-05 8.452e-05 1.184e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.351e-04 1.487e-03 0.091 0.9281
## total_visits_per_capita -3.900e-05 6.693e-05 -0.583 0.5635
## percent_under_125000 9.110e-06 5.177e-06 1.760 0.0865 .
## avg_household_size -2.339e-04 3.352e-04 -0.698 0.4895
## pop_density 1.571e-02 2.980e-02 0.527 0.6013
## `percent more than 1 occupant` 5.828e-05 2.319e-05 2.513 0.0163 *
## `percent more than 1 unit` -8.804e-06 5.728e-06 -1.537 0.1326
## avg_median_age 6.403e-06 1.615e-05 0.397 0.6939
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002768 on 38 degrees of freedom
## Multiple R-squared: 0.5436, Adjusted R-squared: 0.4595
## F-statistic: 6.466 on 7 and 38 DF, p-value: 4.806e-05
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.14435 -0.09989 -0.03119 0.03798 0.57824
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.08060 0.08465 0.952 0.346
## total_visits_per_capita 0.01159 0.01964 0.590 0.558
##
## Residual standard error: 0.1373 on 44 degrees of freedom
## Multiple R-squared: 0.007846, Adjusted R-squared: -0.0147
## F-statistic: 0.348 on 1 and 44 DF, p-value: 0.5583
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.17288 -0.07200 -0.01716 0.03255 0.56830
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.294621 0.719744 0.409 0.685
## total_visits_per_capita -0.002205 0.032407 -0.068 0.946
## percent_under_125000 0.002728 0.002506 1.088 0.283
## avg_household_size -0.035297 0.162279 -0.218 0.829
## pop_density 5.865119 14.429752 0.406 0.687
## `percent more than 1 occupant` 0.003759 0.011226 0.335 0.740
## `percent more than 1 unit` -0.001981 0.002773 -0.714 0.479
## avg_median_age -0.004968 0.007817 -0.636 0.529
##
## Residual standard error: 0.134 on 38 degrees of freedom
## Multiple R-squared: 0.1832, Adjusted R-squared: 0.03278
## F-statistic: 1.218 on 7 and 38 DF, p-value: 0.317
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0003286 -0.0002188 -0.0001523 0.0000503 0.0018923
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.253e-05 3.649e-04 0.254 0.801
## total_visits_per_capita 4.290e-05 8.001e-05 0.536 0.595
##
## Residual standard error: 0.0004069 on 35 degrees of freedom
## Multiple R-squared: 0.008149, Adjusted R-squared: -0.02019
## F-statistic: 0.2875 on 1 and 35 DF, p-value: 0.5952
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.536e-04 -1.779e-04 -1.298e-05 1.089e-04 1.147e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.732e-04 1.789e-03 0.209 0.8362
## total_visits_per_capita -9.502e-05 1.186e-04 -0.801 0.4294
## percent_under_125000 9.308e-06 6.038e-06 1.542 0.1340
## avg_household_size -3.070e-04 3.989e-04 -0.770 0.4477
## pop_density 1.468e-02 4.301e-02 0.341 0.7354
## `percent more than 1 occupant` 6.912e-05 2.960e-05 2.335 0.0267 *
## `percent more than 1 unit` -1.154e-05 7.334e-06 -1.574 0.1263
## avg_median_age 1.274e-05 1.935e-05 0.658 0.5155
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003049 on 29 degrees of freedom
## Multiple R-squared: 0.5386, Adjusted R-squared: 0.4273
## F-statistic: 4.837 on 7 and 29 DF, p-value: 0.001052
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.15079 -0.06826 -0.02999 0.04209 0.27714
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.167637 0.093098 1.801 0.0804 .
## total_visits_per_capita -0.005773 0.020413 -0.283 0.7790
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1038 on 35 degrees of freedom
## Multiple R-squared: 0.00228, Adjusted R-squared: -0.02623
## F-statistic: 0.07997 on 1 and 35 DF, p-value: 0.779
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.12613 -0.03782 -0.01275 0.02639 0.24519
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.840e-01 5.537e-01 0.332 0.742
## total_visits_per_capita -3.256e-02 3.669e-02 -0.887 0.382
## percent_under_125000 2.624e-03 1.868e-03 1.404 0.171
## avg_household_size -1.177e-02 1.234e-01 -0.095 0.925
## pop_density 9.380e+00 1.331e+01 0.705 0.487
## `percent more than 1 occupant` 6.281e-03 9.161e-03 0.686 0.498
## `percent more than 1 unit` -2.835e-03 2.269e-03 -1.249 0.222
## avg_median_age 7.049e-05 5.987e-03 0.012 0.991
##
## Residual standard error: 0.09434 on 29 degrees of freedom
## Multiple R-squared: 0.3174, Adjusted R-squared: 0.1526
## F-statistic: 1.926 on 7 and 29 DF, p-value: 0.1014
##
## [1] "Cases start date: 2020-05-25"
## [1] "Visits start date: 2020-05-11"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.810e-04 -2.177e-04 -8.158e-05 6.453e-05 1.630e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.657e-04 2.406e-04 -0.689 0.4945
## total_visits_per_capita 1.075e-04 5.727e-05 1.877 0.0671 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003865 on 44 degrees of freedom
## Multiple R-squared: 0.07414, Adjusted R-squared: 0.0531
## F-statistic: 3.523 on 1 and 44 DF, p-value: 0.06715
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.967e-04 -1.516e-04 -3.825e-05 1.209e-04 9.147e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.563e-05 1.359e-03 -0.070 0.9443
## total_visits_per_capita -1.258e-04 6.591e-05 -1.909 0.0639 .
## percent_under_125000 1.379e-05 4.819e-06 2.862 0.0068 **
## avg_household_size -4.948e-05 3.061e-04 -0.162 0.8724
## pop_density -3.672e-02 2.743e-02 -1.339 0.1886
## `percent more than 1 occupant` 5.404e-05 2.131e-05 2.536 0.0155 *
## `percent more than 1 unit` -6.456e-06 5.230e-06 -1.235 0.2246
## avg_median_age 3.496e-06 1.485e-05 0.235 0.8152
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002543 on 38 degrees of freedom
## Multiple R-squared: 0.6537, Adjusted R-squared: 0.5899
## F-statistic: 10.25 on 7 and 38 DF, p-value: 3.867e-07
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.810e-04 -2.177e-04 -8.158e-05 6.453e-05 1.630e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.657e-04 2.406e-04 -0.689 0.4945
## total_visits_per_capita 1.075e-04 5.727e-05 1.877 0.0671 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003865 on 44 degrees of freedom
## Multiple R-squared: 0.07414, Adjusted R-squared: 0.0531
## F-statistic: 3.523 on 1 and 44 DF, p-value: 0.06715
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.967e-04 -1.516e-04 -3.825e-05 1.209e-04 9.147e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.563e-05 1.359e-03 -0.070 0.9443
## total_visits_per_capita -1.258e-04 6.591e-05 -1.909 0.0639 .
## percent_under_125000 1.379e-05 4.819e-06 2.862 0.0068 **
## avg_household_size -4.948e-05 3.061e-04 -0.162 0.8724
## pop_density -3.672e-02 2.743e-02 -1.339 0.1886
## `percent more than 1 occupant` 5.404e-05 2.131e-05 2.536 0.0155 *
## `percent more than 1 unit` -6.456e-06 5.230e-06 -1.235 0.2246
## avg_median_age 3.496e-06 1.485e-05 0.235 0.8152
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002543 on 38 degrees of freedom
## Multiple R-squared: 0.6537, Adjusted R-squared: 0.5899
## F-statistic: 10.25 on 7 and 38 DF, p-value: 3.867e-07
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.14534 -0.10662 -0.02081 0.02959 0.56758
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.07988 0.09077 0.880 0.384
## total_visits_per_capita 0.01435 0.02161 0.664 0.510
##
## Residual standard error: 0.1458 on 44 degrees of freedom
## Multiple R-squared: 0.009926, Adjusted R-squared: -0.01258
## F-statistic: 0.4411 on 1 and 44 DF, p-value: 0.5101
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.17800 -0.08023 -0.02361 0.02417 0.60590
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.485221 0.772597 -0.628 0.5337
## total_visits_per_capita -0.041500 0.037482 -1.107 0.2752
## percent_under_125000 0.004830 0.002740 1.762 0.0860 .
## avg_household_size 0.155531 0.174056 0.894 0.3772
## pop_density -26.859376 15.601110 -1.722 0.0933 .
## `percent more than 1 occupant` -0.007465 0.012120 -0.616 0.5416
## `percent more than 1 unit` 0.001982 0.002974 0.667 0.5091
## avg_median_age 0.002588 0.008446 0.306 0.7609
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1446 on 38 degrees of freedom
## Multiple R-squared: 0.1585, Adjusted R-squared: 0.003525
## F-statistic: 1.023 on 7 and 38 DF, p-value: 0.4313
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.719e-04 -2.557e-04 -9.482e-05 6.229e-05 1.626e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.920e-05 3.554e-04 -0.279 0.782
## total_visits_per_capita 9.351e-05 8.056e-05 1.161 0.253
##
## Residual standard error: 0.0004164 on 36 degrees of freedom
## Multiple R-squared: 0.03608, Adjusted R-squared: 0.009303
## F-statistic: 1.347 on 1 and 36 DF, p-value: 0.2534
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.121e-04 -1.921e-04 4.720e-06 1.052e-04 8.443e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.165e-04 1.558e-03 0.332 0.74257
## total_visits_per_capita -1.367e-04 1.036e-04 -1.320 0.19674
## percent_under_125000 1.177e-05 5.419e-06 2.172 0.03792 *
## avg_household_size -2.662e-04 3.530e-04 -0.754 0.45662
## pop_density -2.124e-02 3.794e-02 -0.560 0.57975
## `percent more than 1 occupant` 7.467e-05 2.608e-05 2.863 0.00758 **
## `percent more than 1 unit` -1.077e-05 6.459e-06 -1.667 0.10589
## avg_median_age 7.518e-06 1.671e-05 0.450 0.65610
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002691 on 30 degrees of freedom
## Multiple R-squared: 0.6646, Adjusted R-squared: 0.5863
## F-statistic: 8.492 on 7 and 30 DF, p-value: 1.028e-05
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.14011 -0.04619 -0.00283 0.04307 0.17310
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.150391 0.065463 2.297 0.0275 *
## total_visits_per_capita -0.004451 0.014838 -0.300 0.7659
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.07669 on 36 degrees of freedom
## Multiple R-squared: 0.002493, Adjusted R-squared: -0.02522
## F-statistic: 0.08998 on 1 and 36 DF, p-value: 0.7659
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.11565 -0.03649 0.01315 0.03870 0.09728
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.246462 0.371114 0.664 0.5117
## total_visits_per_capita -0.052614 0.024667 -2.133 0.0412 *
## percent_under_125000 0.001975 0.001291 1.530 0.1364
## avg_household_size -0.064579 0.084074 -0.768 0.4484
## pop_density -7.309366 9.036243 -0.809 0.4249
## `percent more than 1 occupant` 0.013871 0.006212 2.233 0.0332 *
## `percent more than 1 unit` -0.002174 0.001539 -1.413 0.1679
## avg_median_age 0.004406 0.003981 1.107 0.2772
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.06409 on 30 degrees of freedom
## Multiple R-squared: 0.4195, Adjusted R-squared: 0.2841
## F-statistic: 3.097 on 7 and 30 DF, p-value: 0.014
##
## [1] "Cases start date: 2020-06-01"
## [1] "Visits start date: 2020-05-18"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.447e-04 -1.722e-04 -6.263e-05 5.588e-05 1.087e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.543e-05 1.981e-04 -0.482 0.6324
## total_visits_per_capita 7.268e-05 4.301e-05 1.690 0.0982 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003009 on 44 degrees of freedom
## Multiple R-squared: 0.06094, Adjusted R-squared: 0.03959
## F-statistic: 2.855 on 1 and 44 DF, p-value: 0.09815
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.356e-04 -1.127e-04 -7.950e-06 8.397e-05 3.885e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.277e-04 8.377e-04 -0.152 0.879636
## total_visits_per_capita -4.353e-05 3.790e-05 -1.149 0.257890
## percent_under_125000 9.321e-06 2.896e-06 3.219 0.002635 **
## avg_household_size -1.583e-04 1.842e-04 -0.860 0.395372
## pop_density 3.721e-03 1.706e-02 0.218 0.828529
## `percent more than 1 occupant` 5.314e-05 1.314e-05 4.044 0.000248 ***
## `percent more than 1 unit` -6.912e-06 3.212e-06 -2.152 0.037836 *
## avg_median_age 7.928e-06 9.333e-06 0.849 0.400942
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001567 on 38 degrees of freedom
## Multiple R-squared: 0.7799, Adjusted R-squared: 0.7394
## F-statistic: 19.24 on 7 and 38 DF, p-value: 1.06e-10
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.447e-04 -1.722e-04 -6.263e-05 5.588e-05 1.087e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.543e-05 1.981e-04 -0.482 0.6324
## total_visits_per_capita 7.268e-05 4.301e-05 1.690 0.0982 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003009 on 44 degrees of freedom
## Multiple R-squared: 0.06094, Adjusted R-squared: 0.03959
## F-statistic: 2.855 on 1 and 44 DF, p-value: 0.09815
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.356e-04 -1.127e-04 -7.950e-06 8.397e-05 3.885e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.277e-04 8.377e-04 -0.152 0.879636
## total_visits_per_capita -4.353e-05 3.790e-05 -1.149 0.257890
## percent_under_125000 9.321e-06 2.896e-06 3.219 0.002635 **
## avg_household_size -1.583e-04 1.842e-04 -0.860 0.395372
## pop_density 3.721e-03 1.706e-02 0.218 0.828529
## `percent more than 1 occupant` 5.314e-05 1.314e-05 4.044 0.000248 ***
## `percent more than 1 unit` -6.912e-06 3.212e-06 -2.152 0.037836 *
## avg_median_age 7.928e-06 9.333e-06 0.849 0.400942
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001567 on 38 degrees of freedom
## Multiple R-squared: 0.7799, Adjusted R-squared: 0.7394
## F-statistic: 19.24 on 7 and 38 DF, p-value: 1.06e-10
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.10546 -0.06975 -0.00898 0.03015 0.68449
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.1012013 0.0806907 1.254 0.216
## total_visits_per_capita 0.0007039 0.0175169 0.040 0.968
##
## Residual standard error: 0.1225 on 44 degrees of freedom
## Multiple R-squared: 3.67e-05, Adjusted R-squared: -0.02269
## F-statistic: 0.001615 on 1 and 44 DF, p-value: 0.9681
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.10884 -0.05012 -0.01450 0.01868 0.65687
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.2097883 0.6504012 -0.323 0.749
## total_visits_per_capita 0.0026662 0.0294210 0.091 0.928
## percent_under_125000 0.0005599 0.0022484 0.249 0.805
## avg_household_size -0.0109715 0.1429757 -0.077 0.939
## pop_density 16.9988549 13.2456853 1.283 0.207
## `percent more than 1 occupant` 0.0087035 0.0102015 0.853 0.399
## `percent more than 1 unit` -0.0006557 0.0024940 -0.263 0.794
## avg_median_age 0.0055976 0.0072461 0.773 0.445
##
## Residual standard error: 0.1217 on 38 degrees of freedom
## Multiple R-squared: 0.1483, Adjusted R-squared: -0.008634
## F-statistic: 0.945 on 7 and 38 DF, p-value: 0.4842
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.230e-04 -2.009e-04 -7.310e-05 4.938e-05 1.077e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.648e-05 2.644e-04 0.100 0.921
## total_visits_per_capita 4.896e-05 5.526e-05 0.886 0.381
##
## Residual standard error: 0.0003184 on 38 degrees of freedom
## Multiple R-squared: 0.02024, Adjusted R-squared: -0.005539
## F-statistic: 0.7852 on 1 and 38 DF, p-value: 0.3811
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.387e-04 -1.277e-04 -1.033e-05 9.611e-05 3.900e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.919e-05 9.938e-04 -0.039 0.96879
## total_visits_per_capita -5.729e-05 5.155e-05 -1.111 0.27469
## percent_under_125000 9.764e-06 3.120e-06 3.130 0.00372 **
## avg_household_size -1.887e-04 2.099e-04 -0.899 0.37536
## pop_density 6.323e-04 1.936e-02 0.033 0.97414
## `percent more than 1 occupant` 5.625e-05 1.562e-05 3.602 0.00106 **
## `percent more than 1 unit` -7.887e-06 3.926e-06 -2.009 0.05304 .
## avg_median_age 9.361e-06 1.043e-05 0.898 0.37605
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001659 on 32 degrees of freedom
## Multiple R-squared: 0.776, Adjusted R-squared: 0.727
## F-statistic: 15.84 on 7 and 32 DF, p-value: 8.844e-09
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.11073 -0.03934 0.01168 0.03822 0.12140
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.15028 0.04929 3.049 0.00416 **
## total_visits_per_capita -0.01064 0.01030 -1.033 0.30815
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.05936 on 38 degrees of freedom
## Multiple R-squared: 0.02731, Adjusted R-squared: 0.001715
## F-statistic: 1.067 on 1 and 38 DF, p-value: 0.3082
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.084461 -0.029913 -0.001165 0.025914 0.127427
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.1420261 0.2950081 -0.481 0.633
## total_visits_per_capita -0.0238582 0.0153019 -1.559 0.129
## percent_under_125000 0.0015242 0.0009261 1.646 0.110
## avg_household_size 0.0347221 0.0623054 0.557 0.581
## pop_density 3.5039221 5.7460573 0.610 0.546
## `percent more than 1 occupant` 0.0039699 0.0046357 0.856 0.398
## `percent more than 1 unit` -0.0002932 0.0011654 -0.252 0.803
## avg_median_age 0.0033482 0.0030956 1.082 0.288
##
## Residual standard error: 0.04925 on 32 degrees of freedom
## Multiple R-squared: 0.4362, Adjusted R-squared: 0.3128
## F-statistic: 3.536 on 7 and 32 DF, p-value: 0.006332
##
## [1] "Cases start date: 2020-06-08"
## [1] "Visits start date: 2020-05-25"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.883e-04 -1.925e-04 -1.491e-04 5.796e-05 1.210e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.496e-05 2.208e-04 0.294 0.770
## total_visits_per_capita 4.874e-05 5.684e-05 0.858 0.396
##
## Residual standard error: 0.0003547 on 44 degrees of freedom
## Multiple R-squared: 0.01644, Adjusted R-squared: -0.005913
## F-statistic: 0.7355 on 1 and 44 DF, p-value: 0.3958
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.532e-04 -1.127e-04 3.050e-06 1.117e-04 4.518e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.433e-04 9.880e-04 0.854 0.398682
## total_visits_per_capita -7.058e-05 4.831e-05 -1.461 0.152244
## percent_under_125000 1.164e-05 3.296e-06 3.530 0.001105 **
## avg_household_size -3.226e-04 2.183e-04 -1.478 0.147616
## pop_density -1.820e-02 1.864e-02 -0.976 0.335003
## `percent more than 1 occupant` 6.251e-05 1.541e-05 4.058 0.000238 ***
## `percent more than 1 unit` -1.096e-05 3.794e-06 -2.890 0.006341 **
## avg_median_age -2.705e-06 1.086e-05 -0.249 0.804704
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001852 on 38 degrees of freedom
## Multiple R-squared: 0.7686, Adjusted R-squared: 0.7259
## F-statistic: 18.03 on 7 and 38 DF, p-value: 2.661e-10
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.883e-04 -1.925e-04 -1.491e-04 5.796e-05 1.210e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.496e-05 2.208e-04 0.294 0.770
## total_visits_per_capita 4.874e-05 5.684e-05 0.858 0.396
##
## Residual standard error: 0.0003547 on 44 degrees of freedom
## Multiple R-squared: 0.01644, Adjusted R-squared: -0.005913
## F-statistic: 0.7355 on 1 and 44 DF, p-value: 0.3958
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.532e-04 -1.127e-04 3.050e-06 1.117e-04 4.518e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.433e-04 9.880e-04 0.854 0.398682
## total_visits_per_capita -7.058e-05 4.831e-05 -1.461 0.152244
## percent_under_125000 1.164e-05 3.296e-06 3.530 0.001105 **
## avg_household_size -3.226e-04 2.183e-04 -1.478 0.147616
## pop_density -1.820e-02 1.864e-02 -0.976 0.335003
## `percent more than 1 occupant` 6.251e-05 1.541e-05 4.058 0.000238 ***
## `percent more than 1 unit` -1.096e-05 3.794e-06 -2.890 0.006341 **
## avg_median_age -2.705e-06 1.086e-05 -0.249 0.804704
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001852 on 38 degrees of freedom
## Multiple R-squared: 0.7686, Adjusted R-squared: 0.7259
## F-statistic: 18.03 on 7 and 38 DF, p-value: 2.661e-10
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.10803 -0.06308 -0.02620 0.06020 0.14508
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.02340 0.04359 0.537 0.594
## total_visits_per_capita 0.01847 0.01122 1.646 0.107
##
## Residual standard error: 0.07004 on 44 degrees of freedom
## Multiple R-squared: 0.05799, Adjusted R-squared: 0.03658
## F-statistic: 2.709 on 1 and 44 DF, p-value: 0.1069
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.09181 -0.03788 -0.01334 0.04347 0.14160
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.696e-02 3.400e-01 0.138 0.8909
## total_visits_per_capita 1.706e-02 1.662e-02 1.026 0.3113
## percent_under_125000 2.307e-03 1.134e-03 2.034 0.0490 *
## avg_household_size -4.941e-02 7.511e-02 -0.658 0.5146
## pop_density -1.145e+01 6.413e+00 -1.785 0.0823 .
## `percent more than 1 occupant` 3.965e-03 5.301e-03 0.748 0.4592
## `percent more than 1 unit` -2.895e-04 1.306e-03 -0.222 0.8257
## avg_median_age -2.171e-04 3.738e-03 -0.058 0.9540
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.06371 on 38 degrees of freedom
## Multiple R-squared: 0.3268, Adjusted R-squared: 0.2028
## F-statistic: 2.635 on 7 and 38 DF, p-value: 0.02534
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.817e-04 -2.193e-04 -1.350e-04 3.958e-05 1.198e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.867e-04 2.817e-04 1.018 0.315
## total_visits_per_capita -1.888e-06 6.992e-05 -0.027 0.979
##
## Residual standard error: 0.000368 on 39 degrees of freedom
## Multiple R-squared: 1.869e-05, Adjusted R-squared: -0.02562
## F-statistic: 0.000729 on 1 and 39 DF, p-value: 0.9786
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.517e-04 -1.172e-04 -6.000e-08 1.030e-04 4.383e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.175e-03 1.167e-03 1.007 0.321394
## total_visits_per_capita -1.020e-04 7.089e-05 -1.438 0.159816
## percent_under_125000 1.124e-05 3.665e-06 3.068 0.004289 **
## avg_household_size -3.951e-04 2.430e-04 -1.626 0.113518
## pop_density -1.791e-02 2.014e-02 -0.889 0.380305
## `percent more than 1 occupant` 6.946e-05 1.814e-05 3.829 0.000546 ***
## `percent more than 1 unit` -1.312e-05 4.641e-06 -2.828 0.007904 **
## avg_median_age -1.155e-06 1.208e-05 -0.096 0.924377
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.000195 on 33 degrees of freedom
## Multiple R-squared: 0.7624, Adjusted R-squared: 0.712
## F-statistic: 15.13 on 7 and 33 DF, p-value: 1.14e-08
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.10494 -0.05664 -0.01718 0.06199 0.11832
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.1059182 0.0520816 2.034 0.0488 *
## total_visits_per_capita -0.0003711 0.0129275 -0.029 0.9772
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.06803 on 39 degrees of freedom
## Multiple R-squared: 2.113e-05, Adjusted R-squared: -0.02562
## F-statistic: 0.0008242 on 1 and 39 DF, p-value: 0.9772
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.098098 -0.050053 -0.003362 0.043345 0.125592
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.347298 0.389037 0.893 0.3785
## total_visits_per_capita -0.009389 0.023640 -0.397 0.6938
## percent_under_125000 0.001704 0.001222 1.394 0.1727
## avg_household_size -0.081955 0.081034 -1.011 0.3192
## pop_density -12.197078 6.717414 -1.816 0.0785 .
## `percent more than 1 occupant` 0.006717 0.006049 1.110 0.2748
## `percent more than 1 unit` -0.001418 0.001548 -0.916 0.3663
## avg_median_age -0.001111 0.004028 -0.276 0.7845
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.06502 on 33 degrees of freedom
## Multiple R-squared: 0.2271, Adjusted R-squared: 0.06311
## F-statistic: 1.385 on 7 and 33 DF, p-value: 0.2444
##
## [1] "Cases start date: 2020-06-15"
## [1] "Visits start date: 2020-06-01"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.260e-04 -2.523e-04 -1.304e-04 9.908e-05 1.464e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.292e-04 2.491e-04 0.519 0.607
## total_visits_per_capita 6.133e-05 6.447e-05 0.951 0.347
##
## Residual standard error: 0.0004018 on 44 degrees of freedom
## Multiple R-squared: 0.02015, Adjusted R-squared: -0.002117
## F-statistic: 0.9049 on 1 and 44 DF, p-value: 0.3467
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.926e-04 -1.238e-04 -5.383e-05 1.063e-04 6.298e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.524e-03 1.320e-03 1.154 0.25551
## total_visits_per_capita 9.034e-06 6.617e-05 0.137 0.89212
## percent_under_125000 1.346e-05 4.408e-06 3.054 0.00411 **
## avg_household_size -5.401e-04 2.866e-04 -1.884 0.06717 .
## pop_density -2.312e-02 2.489e-02 -0.929 0.35890
## `percent more than 1 occupant` 6.890e-05 2.037e-05 3.382 0.00168 **
## `percent more than 1 unit` -1.364e-05 5.053e-06 -2.699 0.01031 *
## avg_median_age -1.042e-05 1.444e-05 -0.721 0.47517
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002464 on 38 degrees of freedom
## Multiple R-squared: 0.6818, Adjusted R-squared: 0.6231
## F-statistic: 11.63 on 7 and 38 DF, p-value: 8.556e-08
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.260e-04 -2.523e-04 -1.304e-04 9.908e-05 1.464e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.292e-04 2.491e-04 0.519 0.607
## total_visits_per_capita 6.133e-05 6.447e-05 0.951 0.347
##
## Residual standard error: 0.0004018 on 44 degrees of freedom
## Multiple R-squared: 0.02015, Adjusted R-squared: -0.002117
## F-statistic: 0.9049 on 1 and 44 DF, p-value: 0.3467
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.926e-04 -1.238e-04 -5.383e-05 1.063e-04 6.298e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.524e-03 1.320e-03 1.154 0.25551
## total_visits_per_capita 9.034e-06 6.617e-05 0.137 0.89212
## percent_under_125000 1.346e-05 4.408e-06 3.054 0.00411 **
## avg_household_size -5.401e-04 2.866e-04 -1.884 0.06717 .
## pop_density -2.312e-02 2.489e-02 -0.929 0.35890
## `percent more than 1 occupant` 6.890e-05 2.037e-05 3.382 0.00168 **
## `percent more than 1 unit` -1.364e-05 5.053e-06 -2.699 0.01031 *
## avg_median_age -1.042e-05 1.444e-05 -0.721 0.47517
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002464 on 38 degrees of freedom
## Multiple R-squared: 0.6818, Adjusted R-squared: 0.6231
## F-statistic: 11.63 on 7 and 38 DF, p-value: 8.556e-08
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.17848 -0.07364 -0.02801 0.01033 0.56884
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.06434 0.09443 0.681 0.499
## total_visits_per_capita 0.02359 0.02444 0.965 0.340
##
## Residual standard error: 0.1523 on 44 degrees of freedom
## Multiple R-squared: 0.02074, Adjusted R-squared: -0.001511
## F-statistic: 0.9321 on 1 and 44 DF, p-value: 0.3396
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.21213 -0.06288 -0.02051 0.01246 0.56677
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.126e-01 8.505e-01 0.838 0.407
## total_visits_per_capita 4.159e-02 4.263e-02 0.976 0.335
## percent_under_125000 1.214e-04 2.840e-03 0.043 0.966
## avg_household_size -1.116e-01 1.846e-01 -0.604 0.549
## pop_density -1.476e+01 1.604e+01 -0.920 0.363
## `percent more than 1 occupant` 5.848e-04 1.312e-02 0.045 0.965
## `percent more than 1 unit` -3.180e-04 3.255e-03 -0.098 0.923
## avg_median_age -9.286e-03 9.306e-03 -0.998 0.325
##
## Residual standard error: 0.1588 on 38 degrees of freedom
## Multiple R-squared: 0.08095, Adjusted R-squared: -0.08835
## F-statistic: 0.4781 on 7 and 38 DF, p-value: 0.8443
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.130e-04 -2.491e-04 -1.655e-04 8.374e-05 1.434e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.134e-04 2.939e-04 1.066 0.293
## total_visits_per_capita 2.058e-05 7.368e-05 0.279 0.781
##
## Residual standard error: 0.0004136 on 39 degrees of freedom
## Multiple R-squared: 0.001997, Adjusted R-squared: -0.02359
## F-statistic: 0.07803 on 1 and 39 DF, p-value: 0.7815
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.971e-04 -1.326e-04 -3.723e-05 1.544e-04 6.197e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.070e-03 1.524e-03 0.702 0.48779
## total_visits_per_capita 5.761e-05 9.191e-05 0.627 0.53510
## percent_under_125000 1.521e-05 4.944e-06 3.076 0.00419 **
## avg_household_size -5.059e-04 3.150e-04 -1.606 0.11775
## pop_density -1.443e-02 2.644e-02 -0.546 0.58903
## `percent more than 1 occupant` 6.399e-05 2.384e-05 2.684 0.01130 *
## `percent more than 1 unit` -1.275e-05 6.034e-06 -2.113 0.04221 *
## avg_median_age -9.688e-06 1.560e-05 -0.621 0.53884
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002532 on 33 degrees of freedom
## Multiple R-squared: 0.6836, Adjusted R-squared: 0.6164
## F-statistic: 10.18 on 7 and 33 DF, p-value: 1.003e-06
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.18120 -0.06514 -0.01781 0.01258 0.45611
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.04548 0.09045 0.503 0.618
## total_visits_per_capita 0.02805 0.02268 1.237 0.224
##
## Residual standard error: 0.1273 on 39 degrees of freedom
## Multiple R-squared: 0.03775, Adjusted R-squared: 0.01308
## F-statistic: 1.53 on 1 and 39 DF, p-value: 0.2235
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.24656 -0.03926 -0.01336 0.02285 0.39514
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.233172 0.765631 0.305 0.7626
## total_visits_per_capita 0.097434 0.046166 2.110 0.0425 *
## percent_under_125000 0.001666 0.002484 0.671 0.5071
## avg_household_size -0.026204 0.158214 -0.166 0.8695
## pop_density -2.330773 13.282224 -0.175 0.8618
## `percent more than 1 occupant` -0.010072 0.011977 -0.841 0.4064
## `percent more than 1 unit` 0.001399 0.003031 0.462 0.6473
## avg_median_age -0.012062 0.007835 -1.539 0.1333
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1272 on 33 degrees of freedom
## Multiple R-squared: 0.1873, Adjusted R-squared: 0.01486
## F-statistic: 1.086 on 7 and 33 DF, p-value: 0.3943
model_results_1 <- model_results_1 %>%
mutate(visits_start_date = as.Date(cases_start_date) - visits_lag)
There’s a lot of information there, and most of the model fits and their variation over time are better interpreted from the following plots. However, in terms of demographic correlations:
Early on, income and population density seem to be relevant, with r-squared overall about 0.3-0.5 for both log and non log. This changes to similar r-squareds, but occupants per room also starts to be relevant instead of population density, as time moves on. Sometimes the demographic variables do not have significant p values in the log version, or when you exclude ones that start below 10 cases.
At a visits start date of 2020-04-20, only occupants per room has a significant p value for change in cases, with r-squared 0.65. For change in log of cases, only visits has a significant p value, with r-squared of 0.5. Neither have significant p values when you exclude ones that start below 10 cases, however. A visits start date of 2020-05-11 has similar values but ONLY for change in cases, with visits, income, and occupants per room relevant, but none have significant p values for the change in log of cases and the multiple r-squared for the demographics correlation is very low. However, when you exxclude ones that start below 10 cases, the change in log of cases does have significant p values for visits and occupants per room, and the r-squared goes up to 0.4.
The last two weeks show high r-squareds as well for the demographic correlations for change in cases; specifically income, occupants per room, and units per structure seem relevant for change in cases. Change in log of cases has lower r-squareds for these weeks.
I’ll now plot how the model fit values change with each week. Note that in the graphs below, each data point represents the values from a model that uses the week of visits data starting on the date shown on the x axis, and the change in cases over the week that starts two weeks after the visits start date.
model_results_1 %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~r_squared, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~r_squared, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "R squared for that model"), title = "R squared over time, 1 week time interval, 14 day lag, Alameda")
model_results_1 %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "Visits coefficient for that model"), title = "Visits coefficient over time, 1 week time interval, 14 day lag, Alameda")
# split the log and not log for coefficient since log coefficient is much larger
model_results_1 %>% filter(model_type != "change in log of cases, starting above 0" & model_type != "change in log of cases, starting above 10") %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "Visits coefficient for that model"), title = "Visits coefficient over time, 1 week time interval, 14 day lag, only non log, Alameda")
model_results_1 %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~p_val, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~p_val, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "P value of coefficient for that model"), title = "P value of coefficient over time, 1 week time interval, 14 day lag, Alameda")
It does indeed seem that the models are much better in late March and early April, and drop off in ability starting in late April or early May. Which would be consistent with a hypothesized regime change.
However, I’m still not sure how much the fact that in the early time frames numbers of cases were very low would affect these results or the ability to interpret them. The change in log would be affected more drastically by going from a very small number to a slightly less small number (i.e. in the early phases of case growth), so this might mean that in the earlier weeks, zip codes with some case growth that start from a very low level of cases per person have their effects overstated in the models. I’m not sure if this is an issue or not.
I’m also generally unsure about which of the five models I used makes the most sense to look at, which is why I included all five for comparison.
ac_cases_zip_week <- ac_cases_zip %>%
filter(date >= as.Date("2020-03-23")) %>%
filter(as.numeric((date - as.Date("2020-03-23"))) %% 7 == 0) %>%
mutate(log_cases_by_pop = log(cases_by_pop)) %>%
group_by(zipcode) %>%
mutate(change_cases_by_pop = c(NA, diff(cases_by_pop)),
change_log_cases_by_pop = c(NA, diff(log_cases_by_pop)))
ac_cases_zip_week %>% plot_ly() %>%
add_trace(x = ~date, y = ~change_cases_by_pop, type = 'scatter', mode = 'markers', color = ~zipcode) %>%
layout(xaxis = list(title = "Date"), yaxis = list(title = "Change in cases per person relative to a week ago"), title = "Weekly change in cases per person over time")
It is true that there are a few zip codes that have much larger weekly changes in cases as time goes on, but for most of the zip codes the change in cases range is not too different from April through June. However, these few zip codes might have an impact, and this could be relevant? Aside from those, though, it seems that things are mostly on the same scale from early April through mid June.
ac_cases_zip_week %>% plot_ly() %>%
add_trace(x = ~date, y = ~change_log_cases_by_pop, type = 'scatter', mode = 'markers', color = ~zipcode) %>%
layout(xaxis = list(title = "Date"), yaxis = list(title = "Change in log(cases per person) relative to a week ago"), title = "Weekly change in log of cases per person over time")
With the change in log of cases, actually, it’s the reverse, that the big changes occur early on (which makes sense, since the log of a very small number changing to the log of a slightly smaller number can have a big impact). But mid April through early June all seems relatively similar in scale.
Repeat but for a date range of 2 weeks.
cases_start_date <- as.Date("2020-03-23") # first cases start date to use
visits_lag <- 14 # in days
time_window_length <- 14 # in days
# data frame to store results
model_results_2 <- data.frame(model_type = character(), coef_val = numeric(), p_val = numeric(), r_squared = numeric(), cases_start_date = character(), stringsAsFactors = FALSE)
while(cases_start_date + time_window_length <= max(ac_cases_zip$date)) {
model_results_curr <- testVisitsPrediction(ac_visits_zip, ac_cases_zip, cases_start_date, time_window_length, visits_lag, ac_dem_data, "Alameda")
model_results_2 <- rbind(model_results_2, model_results_curr)
cases_start_date <- cases_start_date + time_window_length # run again with new start date
}
## [1] "Cases start date: 2020-03-23"
## [1] "Visits start date: 2020-03-09"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.041e-04 -1.726e-04 -5.122e-05 1.457e-04 5.514e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7.016e-05 1.848e-04 -0.380 0.7060
## total_visits_per_capita 2.714e-05 1.548e-05 1.753 0.0865 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002195 on 44 degrees of freedom
## Multiple R-squared: 0.0653, Adjusted R-squared: 0.04405
## F-statistic: 3.074 on 1 and 44 DF, p-value: 0.08653
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.942e-04 -1.010e-04 -2.948e-05 7.064e-05 4.755e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.390e-05 1.013e-03 -0.033 0.97347
## total_visits_per_capita -2.989e-06 2.114e-05 -0.141 0.88829
## percent_under_125000 7.102e-06 3.385e-06 2.098 0.04259 *
## avg_household_size 1.589e-04 2.242e-04 0.709 0.48284
## pop_density -6.428e-02 1.874e-02 -3.430 0.00147 **
## `percent more than 1 occupant` -1.173e-05 1.567e-05 -0.749 0.45873
## `percent more than 1 unit` 1.903e-06 3.892e-06 0.489 0.62758
## avg_median_age -1.011e-05 1.106e-05 -0.914 0.36653
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001897 on 38 degrees of freedom
## Multiple R-squared: 0.3971, Adjusted R-squared: 0.2861
## F-statistic: 3.576 on 7 and 38 DF, p-value: 0.004735
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.143e-04 -1.475e-04 -6.505e-05 1.088e-04 5.541e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.937e-04 2.022e-04 -1.453 0.155
## total_visits_per_capita 4.408e-05 1.672e-05 2.637 0.012 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002142 on 38 degrees of freedom
## Multiple R-squared: 0.1547, Adjusted R-squared: 0.1324
## F-statistic: 6.954 on 1 and 38 DF, p-value: 0.01205
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.324e-04 -9.394e-05 -1.442e-05 7.081e-05 3.786e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.839e-04 1.016e-03 -0.181 0.85755
## total_visits_per_capita 2.773e-06 2.245e-05 0.124 0.90248
## percent_under_125000 7.160e-06 3.411e-06 2.099 0.04377 *
## avg_household_size 8.481e-05 2.260e-04 0.375 0.70999
## pop_density -6.689e-02 2.211e-02 -3.025 0.00487 **
## `percent more than 1 occupant` 4.422e-06 1.743e-05 0.254 0.80135
## `percent more than 1 unit` 6.989e-07 3.911e-06 0.179 0.85928
## avg_median_age -4.390e-06 1.164e-05 -0.377 0.70864
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0001849 on 32 degrees of freedom
## Multiple R-squared: 0.4698, Adjusted R-squared: 0.3538
## F-statistic: 4.051 on 7 and 32 DF, p-value: 0.00278
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.21781 -0.32631 -0.06563 0.33129 1.60820
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.42113 0.56010 -2.537 0.015398 *
## total_visits_per_capita 0.19135 0.04631 4.132 0.000191 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5934 on 38 degrees of freedom
## Multiple R-squared: 0.31, Adjusted R-squared: 0.2918
## F-statistic: 17.07 on 1 and 38 DF, p-value: 0.0001907
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.09594 -0.21190 0.02201 0.26225 0.89674
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.825e+00 2.695e+00 -1.048 0.30249
## total_visits_per_capita 8.091e-02 5.955e-02 1.359 0.18376
## percent_under_125000 1.278e-02 9.048e-03 1.412 0.16759
## avg_household_size 3.399e-01 5.996e-01 0.567 0.57477
## pop_density -1.624e+02 5.865e+01 -2.769 0.00928 **
## `percent more than 1 occupant` 4.838e-02 4.623e-02 1.046 0.30321
## `percent more than 1 unit` 8.161e-03 1.037e-02 0.787 0.43720
## avg_median_age 2.011e-02 3.088e-02 0.651 0.51962
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4903 on 32 degrees of freedom
## Multiple R-squared: 0.6032, Adjusted R-squared: 0.5164
## F-statistic: 6.95 on 7 and 32 DF, p-value: 4.689e-05
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## ALL 1 residuals are 0: no residual degrees of freedom!
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0003758 NA NA NA
## total_visits_per_capita NA NA NA NA
##
## Residual standard error: NaN on 0 degrees of freedom
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## ALL 1 residuals are 0: no residual degrees of freedom!
##
## Coefficients: (7 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0003758 NA NA NA
## total_visits_per_capita NA NA NA NA
## percent_under_125000 NA NA NA NA
## avg_household_size NA NA NA NA
## pop_density NA NA NA NA
## `percent more than 1 occupant` NA NA NA NA
## `percent more than 1 unit` NA NA NA NA
## avg_median_age NA NA NA NA
##
## Residual standard error: NaN on 0 degrees of freedom
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## ALL 1 residuals are 0: no residual degrees of freedom!
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.9163 NA NA NA
## total_visits_per_capita NA NA NA NA
##
## Residual standard error: NaN on 0 degrees of freedom
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## ALL 1 residuals are 0: no residual degrees of freedom!
##
## Coefficients: (7 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.9163 NA NA NA
## total_visits_per_capita NA NA NA NA
## percent_under_125000 NA NA NA NA
## avg_household_size NA NA NA NA
## pop_density NA NA NA NA
## `percent more than 1 occupant` NA NA NA NA
## `percent more than 1 unit` NA NA NA NA
## avg_median_age NA NA NA NA
##
## Residual standard error: NaN on 0 degrees of freedom
##
## [1] "Cases start date: 2020-04-06"
## [1] "Visits start date: 2020-03-23"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.583e-04 -1.959e-04 -6.233e-05 1.660e-04 1.320e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.112e-04 2.135e-04 -1.927 0.06051 .
## total_visits_per_capita 8.558e-05 2.463e-05 3.474 0.00116 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003174 on 44 degrees of freedom
## Multiple R-squared: 0.2153, Adjusted R-squared: 0.1974
## F-statistic: 12.07 on 1 and 44 DF, p-value: 0.001163
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.149e-04 -1.628e-04 -4.777e-05 8.884e-05 1.082e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.376e-04 1.508e-03 0.357 0.7234
## total_visits_per_capita 4.159e-06 3.853e-05 0.108 0.9146
## percent_under_125000 1.397e-05 5.248e-06 2.661 0.0113 *
## avg_household_size -2.444e-04 3.214e-04 -0.760 0.4517
## pop_density -4.679e-02 3.033e-02 -1.543 0.1312
## `percent more than 1 occupant` 3.002e-05 2.312e-05 1.298 0.2021
## `percent more than 1 unit` -8.070e-06 5.759e-06 -1.401 0.1692
## avg_median_age -5.519e-06 1.718e-05 -0.321 0.7497
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.000279 on 38 degrees of freedom
## Multiple R-squared: 0.4765, Adjusted R-squared: 0.3801
## F-statistic: 4.942 on 7 and 38 DF, p-value: 0.0004837
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.583e-04 -1.959e-04 -6.233e-05 1.660e-04 1.320e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.112e-04 2.135e-04 -1.927 0.06051 .
## total_visits_per_capita 8.558e-05 2.463e-05 3.474 0.00116 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003174 on 44 degrees of freedom
## Multiple R-squared: 0.2153, Adjusted R-squared: 0.1974
## F-statistic: 12.07 on 1 and 44 DF, p-value: 0.001163
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.149e-04 -1.628e-04 -4.777e-05 8.884e-05 1.082e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.376e-04 1.508e-03 0.357 0.7234
## total_visits_per_capita 4.159e-06 3.853e-05 0.108 0.9146
## percent_under_125000 1.397e-05 5.248e-06 2.661 0.0113 *
## avg_household_size -2.444e-04 3.214e-04 -0.760 0.4517
## pop_density -4.679e-02 3.033e-02 -1.543 0.1312
## `percent more than 1 occupant` 3.002e-05 2.312e-05 1.298 0.2021
## `percent more than 1 unit` -8.070e-06 5.759e-06 -1.401 0.1692
## avg_median_age -5.519e-06 1.718e-05 -0.321 0.7497
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.000279 on 38 degrees of freedom
## Multiple R-squared: 0.4765, Adjusted R-squared: 0.3801
## F-statistic: 4.942 on 7 and 38 DF, p-value: 0.0004837
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.58162 -0.31256 -0.06348 0.13711 0.81733
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.52388 0.26758 -1.958 0.056611 .
## total_visits_per_capita 0.12047 0.03088 3.901 0.000324 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3979 on 44 degrees of freedom
## Multiple R-squared: 0.257, Adjusted R-squared: 0.2401
## F-statistic: 15.22 on 1 and 44 DF, p-value: 0.0003239
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.45827 -0.25112 -0.08958 0.14725 1.10073
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.991600 1.996233 -0.998 0.325
## total_visits_per_capita 0.067960 0.051020 1.332 0.191
## percent_under_125000 0.009830 0.006950 1.415 0.165
## avg_household_size 0.127410 0.425589 0.299 0.766
## pop_density 13.009112 40.163206 0.324 0.748
## `percent more than 1 occupant` 0.020214 0.030619 0.660 0.513
## `percent more than 1 unit` 0.001020 0.007625 0.134 0.894
## avg_median_age 0.018648 0.022744 0.820 0.417
##
## Residual standard error: 0.3694 on 38 degrees of freedom
## Multiple R-squared: 0.447, Adjusted R-squared: 0.3452
## F-statistic: 4.388 on 7 and 38 DF, p-value: 0.00119
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0004875 -0.0002281 -0.0001163 0.0001903 0.0012688
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.841e-04 5.646e-04 -0.503 0.619
## total_visits_per_capita 7.632e-05 5.969e-05 1.278 0.212
##
## Residual standard error: 0.000367 on 28 degrees of freedom
## Multiple R-squared: 0.05515, Adjusted R-squared: 0.02141
## F-statistic: 1.634 on 1 and 28 DF, p-value: 0.2116
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.267e-04 -1.634e-04 -4.130e-05 8.205e-05 8.504e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.757e-03 2.146e-03 0.819 0.4217
## total_visits_per_capita -2.625e-05 7.179e-05 -0.366 0.7181
## percent_under_125000 1.591e-05 6.879e-06 2.313 0.0305 *
## avg_household_size -5.703e-04 5.475e-04 -1.042 0.3089
## pop_density -1.119e-01 5.946e-02 -1.882 0.0732 .
## `percent more than 1 occupant` 5.787e-05 4.346e-05 1.331 0.1967
## `percent more than 1 unit` -1.400e-05 8.673e-06 -1.614 0.1208
## avg_median_age -4.409e-06 2.736e-05 -0.161 0.8734
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003172 on 22 degrees of freedom
## Multiple R-squared: 0.4456, Adjusted R-squared: 0.2692
## F-statistic: 2.526 on 7 and 22 DF, p-value: 0.04553
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.62132 -0.22889 -0.08475 0.09513 0.80197
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.59278 0.60770 -0.975 0.3377
## total_visits_per_capita 0.13076 0.06425 2.035 0.0514 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.395 on 28 degrees of freedom
## Multiple R-squared: 0.1289, Adjusted R-squared: 0.09775
## F-statistic: 4.142 on 1 and 28 DF, p-value: 0.0514
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.37693 -0.20451 -0.09016 0.07250 1.06417
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.536733 2.540835 0.605 0.551
## total_visits_per_capita 0.024495 0.085011 0.288 0.776
## percent_under_125000 0.007228 0.008146 0.887 0.384
## avg_household_size -0.362199 0.648300 -0.559 0.582
## pop_density -20.984893 70.411022 -0.298 0.768
## `percent more than 1 occupant` 0.048832 0.051466 0.949 0.353
## `percent more than 1 unit` -0.008722 0.010270 -0.849 0.405
## avg_median_age -0.015182 0.032391 -0.469 0.644
##
## Residual standard error: 0.3755 on 22 degrees of freedom
## Multiple R-squared: 0.3814, Adjusted R-squared: 0.1845
## F-statistic: 1.937 on 7 and 22 DF, p-value: 0.1116
##
## [1] "Cases start date: 2020-04-20"
## [1] "Visits start date: 2020-04-06"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.371e-04 -2.076e-04 -7.195e-05 5.372e-05 1.022e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.205e-04 1.918e-04 -1.671 0.10181
## total_visits_per_capita 7.034e-05 2.253e-05 3.123 0.00317 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002991 on 44 degrees of freedom
## Multiple R-squared: 0.1814, Adjusted R-squared: 0.1628
## F-statistic: 9.751 on 1 and 44 DF, p-value: 0.003166
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.998e-04 -1.296e-04 -3.399e-05 9.847e-05 8.263e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.107e-03 1.318e-03 0.840 0.4061
## total_visits_per_capita 8.465e-06 3.039e-05 0.279 0.7821
## percent_under_125000 9.550e-06 4.606e-06 2.074 0.0450 *
## avg_household_size -4.685e-04 2.855e-04 -1.641 0.1090
## pop_density -3.649e-02 2.614e-02 -1.396 0.1709
## `percent more than 1 occupant` 5.404e-05 2.007e-05 2.693 0.0105 *
## `percent more than 1 unit` -8.428e-06 5.057e-06 -1.666 0.1039
## avg_median_age -3.620e-06 1.455e-05 -0.249 0.8048
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002441 on 38 degrees of freedom
## Multiple R-squared: 0.529, Adjusted R-squared: 0.4422
## F-statistic: 6.097 on 7 and 38 DF, p-value: 8.228e-05
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.371e-04 -2.076e-04 -7.195e-05 5.372e-05 1.022e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.205e-04 1.918e-04 -1.671 0.10181
## total_visits_per_capita 7.034e-05 2.253e-05 3.123 0.00317 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002991 on 44 degrees of freedom
## Multiple R-squared: 0.1814, Adjusted R-squared: 0.1628
## F-statistic: 9.751 on 1 and 44 DF, p-value: 0.003166
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.998e-04 -1.296e-04 -3.399e-05 9.847e-05 8.263e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.107e-03 1.318e-03 0.840 0.4061
## total_visits_per_capita 8.465e-06 3.039e-05 0.279 0.7821
## percent_under_125000 9.550e-06 4.606e-06 2.074 0.0450 *
## avg_household_size -4.685e-04 2.855e-04 -1.641 0.1090
## pop_density -3.649e-02 2.614e-02 -1.396 0.1709
## `percent more than 1 occupant` 5.404e-05 2.007e-05 2.693 0.0105 *
## `percent more than 1 unit` -8.428e-06 5.057e-06 -1.666 0.1039
## avg_median_age -3.620e-06 1.455e-05 -0.249 0.8048
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002441 on 38 degrees of freedom
## Multiple R-squared: 0.529, Adjusted R-squared: 0.4422
## F-statistic: 6.097 on 7 and 38 DF, p-value: 8.228e-05
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.28064 -0.11727 -0.05565 0.05360 0.51807
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.14037 0.12555 -1.118 0.26964
## total_visits_per_capita 0.04698 0.01475 3.185 0.00266 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1958 on 44 degrees of freedom
## Multiple R-squared: 0.1874, Adjusted R-squared: 0.1689
## F-statistic: 10.15 on 1 and 44 DF, p-value: 0.002657
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.23848 -0.09881 -0.06119 0.06594 0.59522
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.235727 1.026513 -0.230 0.8196
## total_visits_per_capita 0.042821 0.023668 1.809 0.0783 .
## percent_under_125000 0.003061 0.003587 0.853 0.3988
## avg_household_size -0.140705 0.222308 -0.633 0.5306
## pop_density 8.042524 20.359053 0.395 0.6950
## `percent more than 1 occupant` 0.016885 0.015628 1.080 0.2868
## `percent more than 1 unit` -0.001150 0.003938 -0.292 0.7718
## avg_median_age 0.006208 0.011328 0.548 0.5869
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1901 on 38 degrees of freedom
## Multiple R-squared: 0.3384, Adjusted R-squared: 0.2165
## F-statistic: 2.776 on 7 and 38 DF, p-value: 0.01962
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.588e-04 -2.354e-04 -1.047e-04 6.654e-05 1.006e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.359e-04 4.492e-04 -0.748 0.46
## total_visits_per_capita 7.408e-05 4.895e-05 1.514 0.14
##
## Residual standard error: 0.0003382 on 32 degrees of freedom
## Multiple R-squared: 0.06681, Adjusted R-squared: 0.03765
## F-statistic: 2.291 on 1 and 32 DF, p-value: 0.1399
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.171e-04 -1.477e-04 -4.167e-05 7.415e-05 7.458e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.666e-03 1.637e-03 1.018 0.3180
## total_visits_per_capita -3.333e-05 6.296e-05 -0.529 0.6010
## percent_under_125000 1.071e-05 5.431e-06 1.972 0.0594 .
## avg_household_size -4.965e-04 3.816e-04 -1.301 0.2046
## pop_density -6.009e-02 3.789e-02 -1.586 0.1249
## `percent more than 1 occupant` 5.781e-05 2.869e-05 2.015 0.0543 .
## `percent more than 1 unit` -8.117e-06 6.780e-06 -1.197 0.2420
## avg_median_age -7.361e-06 2.077e-05 -0.354 0.7260
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002714 on 26 degrees of freedom
## Multiple R-squared: 0.5117, Adjusted R-squared: 0.3802
## F-statistic: 3.892 on 7 and 26 DF, p-value: 0.005004
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.23367 -0.10788 -0.04093 0.09698 0.52535
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.04428 0.22886 0.193 0.848
## total_visits_per_capita 0.02765 0.02494 1.109 0.276
##
## Residual standard error: 0.1723 on 32 degrees of freedom
## Multiple R-squared: 0.037, Adjusted R-squared: 0.006908
## F-statistic: 1.23 on 1 and 32 DF, p-value: 0.2758
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.22515 -0.06085 -0.03200 0.05749 0.30223
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.392416 0.830987 0.472 0.641
## total_visits_per_capita 0.022688 0.031968 0.710 0.484
## percent_under_125000 0.002033 0.002757 0.737 0.468
## avg_household_size -0.098288 0.193756 -0.507 0.616
## pop_density -0.280138 19.238394 -0.015 0.988
## `percent more than 1 occupant` 0.013350 0.014567 0.916 0.368
## `percent more than 1 unit` 0.001170 0.003442 0.340 0.737
## avg_median_age -0.007805 0.010548 -0.740 0.466
##
## Residual standard error: 0.1378 on 26 degrees of freedom
## Multiple R-squared: 0.4995, Adjusted R-squared: 0.3647
## F-statistic: 3.707 on 7 and 26 DF, p-value: 0.00655
##
## [1] "Cases start date: 2020-05-04"
## [1] "Visits start date: 2020-04-20"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.942e-04 -2.604e-04 -8.277e-05 9.431e-05 1.692e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.775e-04 2.563e-04 -1.473 0.14781
## total_visits_per_capita 8.237e-05 2.872e-05 2.868 0.00631 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0004008 on 44 degrees of freedom
## Multiple R-squared: 0.1575, Adjusted R-squared: 0.1384
## F-statistic: 8.228 on 1 and 44 DF, p-value: 0.006312
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.101e-04 -1.468e-04 -2.338e-05 1.336e-04 8.640e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.179e-04 1.456e-03 -0.150 0.88185
## total_visits_per_capita 7.013e-06 3.308e-05 0.212 0.83322
## percent_under_125000 1.024e-05 5.305e-06 1.930 0.06114 .
## avg_household_size -2.488e-04 3.139e-04 -0.793 0.43288
## pop_density 1.641e-02 2.970e-02 0.553 0.58369
## `percent more than 1 occupant` 6.796e-05 2.234e-05 3.043 0.00424 **
## `percent more than 1 unit` -7.787e-06 5.570e-06 -1.398 0.17024
## avg_median_age 8.852e-06 1.602e-05 0.552 0.58386
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002715 on 38 degrees of freedom
## Multiple R-squared: 0.6661, Adjusted R-squared: 0.6046
## F-statistic: 10.83 on 7 and 38 DF, p-value: 2.017e-07
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.942e-04 -2.604e-04 -8.277e-05 9.431e-05 1.692e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.775e-04 2.563e-04 -1.473 0.14781
## total_visits_per_capita 8.237e-05 2.872e-05 2.868 0.00631 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0004008 on 44 degrees of freedom
## Multiple R-squared: 0.1575, Adjusted R-squared: 0.1384
## F-statistic: 8.228 on 1 and 44 DF, p-value: 0.006312
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.101e-04 -1.468e-04 -2.338e-05 1.336e-04 8.640e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.179e-04 1.456e-03 -0.150 0.88185
## total_visits_per_capita 7.013e-06 3.308e-05 0.212 0.83322
## percent_under_125000 1.024e-05 5.305e-06 1.930 0.06114 .
## avg_household_size -2.488e-04 3.139e-04 -0.793 0.43288
## pop_density 1.641e-02 2.970e-02 0.553 0.58369
## `percent more than 1 occupant` 6.796e-05 2.234e-05 3.043 0.00424 **
## `percent more than 1 unit` -7.787e-06 5.570e-06 -1.398 0.17024
## avg_median_age 8.852e-06 1.602e-05 0.552 0.58386
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002715 on 38 degrees of freedom
## Multiple R-squared: 0.6661, Adjusted R-squared: 0.6046
## F-statistic: 10.83 on 7 and 38 DF, p-value: 2.017e-07
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.26650 -0.16091 -0.05792 0.09496 0.56972
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.07937 0.13326 0.596 0.555
## total_visits_per_capita 0.01768 0.01493 1.184 0.243
##
## Residual standard error: 0.2084 on 44 degrees of freedom
## Multiple R-squared: 0.03089, Adjusted R-squared: 0.008862
## F-statistic: 1.402 on 1 and 44 DF, p-value: 0.2427
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.31347 -0.08291 -0.01794 0.09641 0.38555
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.8309490 0.8322853 -0.998 0.324
## total_visits_per_capita 0.0077586 0.0189074 0.410 0.684
## percent_under_125000 0.0042229 0.0030324 1.393 0.172
## avg_household_size 0.1209979 0.1794275 0.674 0.504
## pop_density 38.7726066 16.9752983 2.284 0.028 *
## `percent more than 1 occupant` 0.0074103 0.0127685 0.580 0.565
## `percent more than 1 unit` 0.0002723 0.0031840 0.086 0.932
## avg_median_age 0.0057910 0.0091590 0.632 0.531
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1552 on 38 degrees of freedom
## Multiple R-squared: 0.5359, Adjusted R-squared: 0.4504
## F-statistic: 6.269 on 7 and 38 DF, p-value: 6.396e-05
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.275e-04 -2.853e-04 -9.491e-05 9.463e-05 1.662e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.999e-04 5.292e-04 -0.756 0.455
## total_visits_per_capita 8.763e-05 5.554e-05 1.578 0.124
##
## Residual standard error: 0.0004394 on 34 degrees of freedom
## Multiple R-squared: 0.06821, Adjusted R-squared: 0.04081
## F-statistic: 2.489 on 1 and 34 DF, p-value: 0.1239
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.533e-04 -1.573e-04 -5.257e-05 1.681e-04 8.502e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.142e-04 1.716e-03 0.300 0.7667
## total_visits_per_capita -5.762e-05 6.807e-05 -0.846 0.4045
## percent_under_125000 1.174e-05 6.334e-06 1.854 0.0743 .
## avg_household_size 3.954e-06 4.022e-04 0.010 0.9922
## pop_density 1.929e-02 4.481e-02 0.431 0.6700
## `percent more than 1 occupant` 4.604e-05 3.054e-05 1.508 0.1429
## `percent more than 1 unit` -6.051e-06 7.035e-06 -0.860 0.3970
## avg_median_age -1.271e-05 2.176e-05 -0.584 0.5636
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002887 on 28 degrees of freedom
## Multiple R-squared: 0.6688, Adjusted R-squared: 0.586
## F-statistic: 8.078 on 7 and 28 DF, p-value: 2.243e-05
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.28187 -0.12476 -0.03656 0.07025 0.52544
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.249504 0.225992 1.104 0.277
## total_visits_per_capita 0.003059 0.023718 0.129 0.898
##
## Residual standard error: 0.1877 on 34 degrees of freedom
## Multiple R-squared: 0.0004889, Adjusted R-squared: -0.02891
## F-statistic: 0.01663 on 1 and 34 DF, p-value: 0.8982
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.27592 -0.08846 -0.02511 0.08044 0.33614
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.1268761 0.8593468 -0.148 0.884
## total_visits_per_capita -0.0168713 0.0340848 -0.495 0.624
## percent_under_125000 0.0048755 0.0031717 1.537 0.135
## avg_household_size 0.0860445 0.2014036 0.427 0.672
## pop_density 33.6119251 22.4364468 1.498 0.145
## `percent more than 1 occupant` 0.0031704 0.0152909 0.207 0.837
## `percent more than 1 unit` -0.0007145 0.0035228 -0.203 0.841
## avg_median_age -0.0020794 0.0108935 -0.191 0.850
##
## Residual standard error: 0.1446 on 28 degrees of freedom
## Multiple R-squared: 0.5115, Adjusted R-squared: 0.3894
## F-statistic: 4.189 on 7 and 28 DF, p-value: 0.002858
##
## [1] "Cases start date: 2020-05-18"
## [1] "Visits start date: 2020-05-04"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0006795 -0.0004172 -0.0001647 0.0001248 0.0035495
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.878e-04 4.585e-04 -0.628 0.5335
## total_visits_per_capita 9.631e-05 5.390e-05 1.787 0.0808 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0007349 on 44 degrees of freedom
## Multiple R-squared: 0.06766, Adjusted R-squared: 0.04647
## F-statistic: 3.193 on 1 and 44 DF, p-value: 0.08084
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.471e-04 -3.042e-04 1.286e-05 2.240e-04 2.094e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.802e-06 2.698e-03 -0.001 0.9989
## total_visits_per_capita -7.848e-05 6.429e-05 -1.221 0.2297
## percent_under_125000 2.265e-05 9.501e-06 2.385 0.0222 *
## avg_household_size -2.893e-04 6.102e-04 -0.474 0.6381
## pop_density -2.000e-02 5.453e-02 -0.367 0.7158
## `percent more than 1 occupant` 1.127e-04 4.224e-05 2.667 0.0112 *
## `percent more than 1 unit` -1.510e-05 1.039e-05 -1.453 0.1545
## avg_median_age 1.083e-05 2.937e-05 0.369 0.7144
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0005038 on 38 degrees of freedom
## Multiple R-squared: 0.6215, Adjusted R-squared: 0.5518
## F-statistic: 8.914 on 7 and 38 DF, p-value: 1.863e-06
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0006795 -0.0004172 -0.0001647 0.0001248 0.0035495
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.878e-04 4.585e-04 -0.628 0.5335
## total_visits_per_capita 9.631e-05 5.390e-05 1.787 0.0808 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0007349 on 44 degrees of freedom
## Multiple R-squared: 0.06766, Adjusted R-squared: 0.04647
## F-statistic: 3.193 on 1 and 44 DF, p-value: 0.08084
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.471e-04 -3.042e-04 1.286e-05 2.240e-04 2.094e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.802e-06 2.698e-03 -0.001 0.9989
## total_visits_per_capita -7.848e-05 6.429e-05 -1.221 0.2297
## percent_under_125000 2.265e-05 9.501e-06 2.385 0.0222 *
## avg_household_size -2.893e-04 6.102e-04 -0.474 0.6381
## pop_density -2.000e-02 5.453e-02 -0.367 0.7158
## `percent more than 1 occupant` 1.127e-04 4.224e-05 2.667 0.0112 *
## `percent more than 1 unit` -1.510e-05 1.039e-05 -1.453 0.1545
## avg_median_age 1.083e-05 2.937e-05 0.369 0.7144
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0005038 on 38 degrees of freedom
## Multiple R-squared: 0.6215, Adjusted R-squared: 0.5518
## F-statistic: 8.914 on 7 and 38 DF, p-value: 1.863e-06
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.25890 -0.15630 -0.04504 0.06665 0.64415
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.14078 0.13261 1.062 0.294
## total_visits_per_capita 0.01533 0.01559 0.984 0.331
##
## Residual standard error: 0.2125 on 44 degrees of freedom
## Multiple R-squared: 0.02152, Adjusted R-squared: -0.0007182
## F-statistic: 0.9677 on 1 and 44 DF, p-value: 0.3306
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.26177 -0.13389 -0.04288 0.10446 0.61946
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.980e-01 1.098e+00 -0.180 0.8578
## total_visits_per_capita -1.711e-02 2.616e-02 -0.654 0.5169
## percent_under_125000 7.301e-03 3.865e-03 1.889 0.0666 .
## avg_household_size 1.062e-01 2.482e-01 0.428 0.6711
## pop_density -1.937e+01 2.218e+01 -0.873 0.3881
## `percent more than 1 occupant` -3.168e-03 1.719e-02 -0.184 0.8548
## `percent more than 1 unit` 2.094e-05 4.228e-03 0.005 0.9961
## avg_median_age -1.946e-03 1.195e-02 -0.163 0.8715
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.205 on 38 degrees of freedom
## Multiple R-squared: 0.214, Adjusted R-squared: 0.06917
## F-statistic: 1.478 on 7 and 38 DF, p-value: 0.2046
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0006577 -0.0004660 -0.0002563 0.0001222 0.0035206
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.355e-05 7.353e-04 -0.032 0.975
## total_visits_per_capita 6.998e-05 8.168e-05 0.857 0.397
##
## Residual standard error: 0.0008123 on 35 degrees of freedom
## Multiple R-squared: 0.02054, Adjusted R-squared: -0.007443
## F-statistic: 0.734 on 1 and 35 DF, p-value: 0.3974
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0008603 -0.0003439 -0.0000055 0.0002138 0.0019830
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.972e-04 3.281e-03 0.243 0.8097
## total_visits_per_capita -1.104e-04 1.130e-04 -0.977 0.3367
## percent_under_125000 2.085e-05 1.115e-05 1.871 0.0714 .
## avg_household_size -5.751e-04 7.296e-04 -0.788 0.4370
## pop_density -3.512e-03 8.033e-02 -0.044 0.9654
## `percent more than 1 occupant` 1.443e-04 5.387e-05 2.678 0.0121 *
## `percent more than 1 unit` -2.220e-05 1.337e-05 -1.660 0.1076
## avg_median_age 2.153e-05 3.518e-05 0.612 0.5452
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0005557 on 29 degrees of freedom
## Multiple R-squared: 0.6202, Adjusted R-squared: 0.5285
## F-statistic: 6.765 on 7 and 29 DF, p-value: 8.56e-05
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.24382 -0.10062 -0.02278 0.07641 0.41494
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.286374 0.142622 2.008 0.0524 .
## total_visits_per_capita -0.001682 0.015843 -0.106 0.9161
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1576 on 35 degrees of freedom
## Multiple R-squared: 0.0003219, Adjusted R-squared: -0.02824
## F-statistic: 0.01127 on 1 and 35 DF, p-value: 0.9161
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.206107 -0.082919 0.009817 0.070948 0.275952
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.328455 0.779103 0.422 0.676
## total_visits_per_capita -0.037951 0.026829 -1.415 0.168
## percent_under_125000 0.004442 0.002646 1.678 0.104
## avg_household_size -0.073012 0.173235 -0.421 0.677
## pop_density 4.878472 19.074718 0.256 0.800
## `percent more than 1 occupant` 0.020433 0.012791 1.597 0.121
## `percent more than 1 unit` -0.004888 0.003175 -1.539 0.135
## avg_median_age 0.005692 0.008353 0.681 0.501
##
## Residual standard error: 0.132 on 29 degrees of freedom
## Multiple R-squared: 0.4191, Adjusted R-squared: 0.2789
## F-statistic: 2.989 on 7 and 29 DF, p-value: 0.01728
##
## [1] "Cases start date: 2020-06-01"
## [1] "Visits start date: 2020-05-18"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.060e-04 -3.447e-04 -1.999e-04 5.789e-05 2.301e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7.515e-05 4.200e-04 -0.179 0.859
## total_visits_per_capita 6.715e-05 4.952e-05 1.356 0.182
##
## Residual standard error: 0.0006431 on 44 degrees of freedom
## Multiple R-squared: 0.04011, Adjusted R-squared: 0.0183
## F-statistic: 1.839 on 1 and 44 DF, p-value: 0.182
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.452e-04 -2.473e-04 1.733e-05 1.379e-04 8.441e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.383e-04 1.693e-03 0.436 0.665293
## total_visits_per_capita -6.236e-05 4.093e-05 -1.523 0.135921
## percent_under_125000 2.133e-05 5.717e-06 3.731 0.000622 ***
## avg_household_size -4.633e-04 3.743e-04 -1.238 0.223383
## pop_density -1.752e-02 3.327e-02 -0.527 0.601512
## `percent more than 1 occupant` 1.148e-04 2.650e-05 4.331 0.000105 ***
## `percent more than 1 unit` -1.785e-05 6.497e-06 -2.747 0.009132 **
## avg_median_age 4.487e-06 1.874e-05 0.239 0.812044
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003171 on 38 degrees of freedom
## Multiple R-squared: 0.7985, Adjusted R-squared: 0.7613
## F-statistic: 21.51 on 7 and 38 DF, p-value: 2.1e-11
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.060e-04 -3.447e-04 -1.999e-04 5.789e-05 2.301e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7.515e-05 4.200e-04 -0.179 0.859
## total_visits_per_capita 6.715e-05 4.952e-05 1.356 0.182
##
## Residual standard error: 0.0006431 on 44 degrees of freedom
## Multiple R-squared: 0.04011, Adjusted R-squared: 0.0183
## F-statistic: 1.839 on 1 and 44 DF, p-value: 0.182
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.452e-04 -2.473e-04 1.733e-05 1.379e-04 8.441e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.383e-04 1.693e-03 0.436 0.665293
## total_visits_per_capita -6.236e-05 4.093e-05 -1.523 0.135921
## percent_under_125000 2.133e-05 5.717e-06 3.731 0.000622 ***
## avg_household_size -4.633e-04 3.743e-04 -1.238 0.223383
## pop_density -1.752e-02 3.327e-02 -0.527 0.601512
## `percent more than 1 occupant` 1.148e-04 2.650e-05 4.331 0.000105 ***
## `percent more than 1 unit` -1.785e-05 6.497e-06 -2.747 0.009132 **
## avg_median_age 4.487e-06 1.874e-05 0.239 0.812044
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003171 on 38 degrees of freedom
## Multiple R-squared: 0.7985, Adjusted R-squared: 0.7613
## F-statistic: 21.51 on 7 and 38 DF, p-value: 2.1e-11
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.21841 -0.09753 0.00957 0.06239 0.68311
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.09351 0.09787 0.955 0.345
## total_visits_per_capita 0.01258 0.01154 1.090 0.282
##
## Residual standard error: 0.1498 on 44 degrees of freedom
## Multiple R-squared: 0.0263, Adjusted R-squared: 0.004173
## F-statistic: 1.189 on 1 and 44 DF, p-value: 0.2816
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.15328 -0.09064 -0.01232 0.05573 0.67385
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.1802113 0.7618213 -0.237 0.814
## total_visits_per_capita 0.0147048 0.0184146 0.799 0.430
## percent_under_125000 0.0026245 0.0025721 1.020 0.314
## avg_household_size -0.0760825 0.1684119 -0.452 0.654
## pop_density 7.8375635 14.9699174 0.524 0.604
## `percent more than 1 occupant` 0.0133714 0.0119235 1.121 0.269
## `percent more than 1 unit` -0.0009592 0.0029231 -0.328 0.745
## avg_median_age 0.0059242 0.0084305 0.703 0.487
##
## Residual standard error: 0.1426 on 38 degrees of freedom
## Multiple R-squared: 0.2378, Adjusted R-squared: 0.09743
## F-statistic: 1.694 on 7 and 38 DF, p-value: 0.1399
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.776e-04 -3.726e-04 -2.132e-04 -2.044e-05 2.254e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.968e-04 5.547e-04 0.535 0.596
## total_visits_per_capita 2.828e-05 6.297e-05 0.449 0.656
##
## Residual standard error: 0.0006797 on 38 degrees of freedom
## Multiple R-squared: 0.00528, Adjusted R-squared: -0.0209
## F-statistic: 0.2017 on 1 and 38 DF, p-value: 0.6559
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.481e-04 -2.534e-04 1.002e-05 1.532e-04 8.205e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.371e-03 2.031e-03 0.675 0.504567
## total_visits_per_capita -9.111e-05 5.844e-05 -1.559 0.128841
## percent_under_125000 2.110e-05 6.278e-06 3.361 0.002025 **
## avg_household_size -6.055e-04 4.268e-04 -1.419 0.165637
## pop_density -1.999e-02 3.755e-02 -0.532 0.598145
## `percent more than 1 occupant` 1.284e-04 3.180e-05 4.036 0.000317 ***
## `percent more than 1 unit` -2.197e-05 8.065e-06 -2.724 0.010359 *
## avg_median_age 7.292e-06 2.106e-05 0.346 0.731404
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0003372 on 32 degrees of freedom
## Multiple R-squared: 0.7938, Adjusted R-squared: 0.7488
## F-statistic: 17.6 on 7 and 32 DF, p-value: 2.476e-09
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.19822 -0.05194 0.01621 0.05370 0.23428
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.252062 0.078773 3.200 0.00277 **
## total_visits_per_capita -0.005423 0.008943 -0.606 0.54782
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.09653 on 38 degrees of freedom
## Multiple R-squared: 0.009586, Adjusted R-squared: -0.01648
## F-statistic: 0.3678 on 1 and 38 DF, p-value: 0.5478
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.130466 -0.057630 0.005631 0.050162 0.141400
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.235021 0.484105 0.485 0.6306
## total_visits_per_capita -0.020045 0.013930 -1.439 0.1599
## percent_under_125000 0.003110 0.001496 2.079 0.0457 *
## avg_household_size -0.044217 0.101728 -0.435 0.6667
## pop_density -8.928830 8.949882 -0.998 0.3259
## `percent more than 1 occupant` 0.010810 0.007580 1.426 0.1635
## `percent more than 1 unit` -0.001833 0.001922 -0.954 0.3474
## avg_median_age 0.002175 0.005020 0.433 0.6677
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.08038 on 32 degrees of freedom
## Multiple R-squared: 0.4217, Adjusted R-squared: 0.2952
## F-statistic: 3.333 on 7 and 32 DF, p-value: 0.00883
model_results_2 <- model_results_2 %>%
mutate(visits_start_date = as.Date(cases_start_date) - visits_lag)
model_results_2 %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~r_squared, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~r_squared, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "R squared for that model"), title = "R squared over time, 2 week time interval, 14 day lag")
model_results_2 %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "Visits coefficient for that model"), title = "Visits coefficient over time, 2 week time interval, 14 day lag")
# split the log and not log for coefficient since log coefficient is much larger
model_results_2 %>% filter(model_type != "change in log of cases, starting above 0" & model_type != "change in log of cases, starting above 10") %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "Visits coefficient for that model"), title = "Visits coefficient over time, 2 week time interval, 14 day lag, only non log")
model_results_2 %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~p_val, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~p_val, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "P value of coefficient for that model"), title = "P value of coefficient over time, 2 week time interval, 14 day lag")
This is pretty consistent with the findings for using one week.
I repeat the first of the above two analyses, but for San Francisco county.
# first load relevant zip codes and block groups they contain
# block groups
sf_blockgroups <-
block_groups("CA","San Francisco", cb=F, progress_bar=F) %>%
st_transform('+proj=longlat +datum=WGS84')
sf_bgs <- sf_blockgroups %>% pull(GEOID)
sf_bg_zctas <- sf_blockgroups %>%
st_centroid() %>%
st_join(zctas_94_95) %>%
dplyr::select(GEOID, ZCTA5CE10) %>%
rename(blockgroup = GEOID, zipcode = ZCTA5CE10)
sf_fips <- fips("CA", "San Francisco") %>% substr(3,5)
sf_pop_zip <- pullCensus("B01003_001E", sf_fips) %>%
left_join(sf_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_pop_zip = sum(B01003_001E))
# SF case data
sf_cases_zip <-
read_csv("https://raw.githubusercontent.com/datadesk/california-coronavirus-data/master/latimes-place-totals.csv") %>%
filter(county == 'San Francisco') %>%
rename(cases = confirmed_cases, zipcode = place) %>%
left_join(sf_pop_zip) %>%
mutate(cases_by_pop = cases / total_pop_zip)
# load sf visits data
sf_visits_zip_1 <- readRDS(paste0(sg_path, "weekly-patterns/v2/sf_zip_visits_daily_sum_hourly_03-09-20_05-24-20.rds"))
sf_visits_zip_2 <- readRDS(paste0(sg_path, "weekly-patterns/v2/sf_zip_visits_daily_sum_hourly_05-25-20_06-21-20.rds"))
sf_visits_zip <- rbind(sf_visits_zip_1, sf_visits_zip_2)
# get visits per capita
sf_visits_zip <- sf_visits_zip %>% left_join(sf_pop_zip) %>%
rename(total_visits = total_visits_avg) %>%
mutate(visits_per_capita = total_visits / total_pop_zip)
# get demographic data
sf_pop_bg <- pullCensus("B01003_001E", sf_fips) %>%
rename(total_pop = B01003_001E)
# average household size
sf_avg_household_size <- pullCensus("B25010_001E", sf_fips) %>%
filter(B25010_001E > 0) %>%
left_join(sf_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
left_join(sf_pop_bg) %>%
group_by(zipcode) %>%
summarize(avg_household_size = weighted.mean(B25010_001E, total_pop)) %>%
filter(!is.na(zipcode))
# occupants per room
sf_occupants_zip <- pullCensus("group(B25014)", sf_fips) %>%
dplyr::select(-c(contains("EA"),contains("MA"),contains("M"))) %>%
gather(key = "variable", value = "estimate", -blockgroup) %>%
mutate(label = acs_vars$label[match(variable,acs_vars$name)]) %>%
dplyr::select(-variable) %>%
separate(label, into = c(NA, NA, NA,"occupants per room"), sep = "!!") %>%
filter(!is.na(`occupants per room`)) %>%
group_by(blockgroup, `occupants per room`) %>%
summarize(estimate_tot = sum(estimate)) %>%
spread(key = `occupants per room`, value = estimate_tot) %>%
mutate(total_nums = `0.50 or less occupants per room` + `0.51 to 1.00 occupants per room` + `1.01 to 1.50 occupants per room` + `1.51 to 2.00 occupants per room` + `2.01 or more occupants per room`) %>%
left_join(sf_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_nums = sum(total_nums), total_0.5less = sum(`0.50 or less occupants per room`), total_0.5to1 = sum(`0.51 to 1.00 occupants per room`), total_1to1.5 = sum(`1.01 to 1.50 occupants per room`), total_1.5to2 = sum(`1.51 to 2.00 occupants per room`), total_2more = sum(`2.01 or more occupants per room`)) %>%
mutate(`percent more than 1 occupant` = (total_1to1.5 + total_1.5to2 + total_2more) * 100/ total_nums, `percent less than 1 occupant` = (100-`percent more than 1 occupant`), `percent 0.5 or less occupants` = total_0.5less*100/total_nums, `percent more than 0.5 occupants` = (100-`percent 0.5 or less occupants`), `percent more than 2 occupants` = total_2more*100/total_nums)
# population density
sf_pop_density_zip <- sf_cases_zip %>% filter(date == max(date)) %>%
dplyr::select(zipcode, total_pop_zip) %>%
left_join(zctas_94_95, by = c("zipcode" = "ZCTA5CE10")) %>%
st_as_sf() %>%
mutate(zip_area = st_area(.), pop_density = total_pop_zip / zip_area) %>%
filter(!is.na(pop_density))
# bucketed household size
sf_house_size_zip <- pullCensus("group(B11016)", sf_fips) %>%
dplyr::select(-c(contains("EA"),contains("MA"),contains("M"))) %>%
gather(key = "variable", value = "estimate", -blockgroup) %>%
mutate(label = acs_vars$label[match(variable,acs_vars$name)]) %>%
dplyr::select(-variable) %>%
separate(label, into = c(NA, NA, "type", "size"), sep = "!!") %>%
filter(!is.na(type)) %>%
filter(!is.na(size)) %>%
dplyr::select(-type) %>%
group_by(blockgroup, size) %>%
summarize(`total of this size` = sum(estimate)) %>%
spread(key = size, value = `total of this size`) %>%
mutate(total_nums = `1-person household` + `2-person household` + `3-person household` + `4-person household` + `5-person household`+ `6-person household` + `7-or-more person household`) %>%
left_join(sf_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_nums = sum(total_nums), total_1 = sum(`1-person household`), total_2 = sum(`2-person household`), total_3 = sum(`3-person household`), total_4 = sum(`4-person household`), total_5 = sum(`5-person household`), total_6 = sum(`6-person household`), total_7more = sum(`7-or-more person household`)) %>%
mutate(`percent 5 or more` = (total_5 + total_6 + total_7more)* 100/ total_nums, `percent 1 or 2 only` = (total_1 + total_2)*100/total_nums)
# units in structure
sf_units_zip <- pullCensus("group(B25024)", sf_fips) %>% dplyr::select(-c(contains("EA"),contains("MA"),contains("M"))) %>%
gather(key = "variable", value = "estimate", -blockgroup) %>%
mutate(label = acs_vars$label[match(variable,acs_vars$name)]) %>%
dplyr::select(-variable) %>%
separate(label, into = c(NA, NA, "units"), sep = "!!") %>%
filter(!is.na(units)) %>%
spread(key = units, value = estimate) %>%
mutate(total_nums = `1, attached` + `1, detached` + `10 to 19` + `2` + `20 to 49`+ `3 or 4` + `5 to 9`+ `50 or more`+ `Boat, RV, van, etc.`+ `Mobile home`, total_20more = `20 to 49`+`50 or more`, total_10more = `10 to 19` + `20 to 49`+`50 or more`, total_1 = `1, attached` + `1, detached`) %>%
left_join(sf_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_nums = sum(total_nums), total_20more = sum(total_20more), total_10more = sum(total_20more), total_1_only = sum(total_1)) %>%
mutate(`percent 10 or more units` = total_10more*100/total_nums, `percent 20 or more units` = total_20more*100/total_nums, `percent 1 only` = total_1_only*100/total_nums, `percent more than 1 unit` = (100 - `percent 1 only`))
# income
sf_income_zip <- pullCensus("group(B19001)", sf_fips) %>% dplyr::select(-c(contains("EA"),contains("MA"),contains("M"))) %>%
gather(key = "variable", value = "estimate", -blockgroup) %>%
mutate(label = acs_vars$label[match(variable,acs_vars$name)]) %>%
dplyr::select(-variable) %>%
separate(label, into = c(NA, NA, "income"), sep = "!!") %>%
filter(!is.na(income)) %>%
spread(key = income, value = estimate) %>%
mutate(total_nums = `Less than $10,000` + `$10,000 to $14,999` + `$15,000 to $19,999` + `$20,000 to $24,999` + `$25,000 to $29,999` + `$30,000 to $34,999` + `$35,000 to $39,999` + `$40,000 to $44,999` + `$45,000 to $49,999` + `$50,000 to $59,999` + `$60,000 to $74,999` + `$75,000 to $99,999` + `$100,000 to $124,999` + `$125,000 to $149,999` + `$150,000 to $199,999` + `$200,000 or more`, over_75000 = `$75,000 to $99,999` + `$100,000 to $124,999` + `$125,000 to $149,999` + `$150,000 to $199,999` + `$200,000 or more`, over_100000 = `$100,000 to $124,999` + `$125,000 to $149,999` + `$150,000 to $199,999` + `$200,000 or more`, over_125000 = `$125,000 to $149,999` + `$150,000 to $199,999` + `$200,000 or more`) %>%
left_join(sf_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
group_by(zipcode) %>%
summarize(total_nums = sum(total_nums), total_over_75000 = sum(over_75000), total_over_100000 = sum(over_100000), total_over_125000 = sum(over_125000)) %>%
mutate(percent_over_75000 = total_over_75000*100 / total_nums,
percent_under_75000 = (100 - percent_over_75000),
percent_over_100000 = total_over_100000*100 / total_nums,
percent_under_100000 = (100 - percent_over_100000),
percent_over_125000 = total_over_125000*100 / total_nums,
percent_under_125000 = (100 - percent_over_125000))
# median age
sf_median_age_zip <- pullCensus("B01002_001E", sf_fips) %>%
rename(median_age = B01002_001E) %>%
filter(median_age > 0) %>% # remove invalid results
left_join(sf_bg_zctas %>% dplyr::select(blockgroup, zipcode)) %>%
left_join(sf_pop_bg) %>%
group_by(zipcode) %>%
summarize(avg_median_age = weighted.mean(median_age, total_pop)) %>%
filter(!is.na(zipcode))
sf_dem_data <- left_join(sf_avg_household_size, sf_pop_density_zip %>% dplyr::select(pop_density, zipcode)) %>%
left_join(sf_occupants_zip %>% dplyr::select(`percent more than 1 occupant`, `percent more than 0.5 occupants`, `percent more than 2 occupants`, zipcode)) %>%
left_join(sf_units_zip %>% dplyr::select(`percent 10 or more units`, `percent more than 1 unit`, zipcode)) %>%
left_join(sf_income_zip %>% dplyr::select(percent_under_75000, percent_under_100000, percent_under_125000, zipcode)) %>%
left_join(sf_median_age_zip) %>%
as.data.frame() %>%
filter(!is.na(zipcode) & !is.na(avg_household_size))
cases_start_date <- as.Date("2020-04-21") # first cases start date to use, SF data doesn't start till 4/20 and some days are missing
visits_lag <- 14 # in days
time_window_length <- 7 # in days
# data frame to store results
model_results_1_sf <- data.frame(model_type = character(), coef_val = numeric(), p_val = numeric(), r_squared = numeric(), cases_start_date = character(), stringsAsFactors = FALSE)
while(cases_start_date + time_window_length <= max(sf_cases_zip$date)) {
model_results_curr <- testVisitsPrediction(sf_visits_zip, sf_cases_zip, cases_start_date, time_window_length, visits_lag, sf_dem_data, "San Francisco")
model_results_1_sf <- rbind(model_results_1_sf, model_results_curr)
cases_start_date <- cases_start_date + time_window_length # run again with new start date
}
## [1] "Cases start date: 2020-04-21"
## [1] "Visits start date: 2020-04-07"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.774e-04 -1.546e-04 -8.217e-05 2.702e-05 9.709e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.581e-05 2.312e-04 -0.112 0.912
## total_visits_per_capita 8.601e-05 7.446e-05 1.155 0.260
##
## Residual standard error: 0.0002826 on 23 degrees of freedom
## Multiple R-squared: 0.05482, Adjusted R-squared: 0.01373
## F-statistic: 1.334 on 1 and 23 DF, p-value: 0.2599
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.170e-04 -1.518e-04 -8.907e-05 1.306e-04 8.255e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.655e-04 2.046e-03 -0.130 0.898
## total_visits_per_capita 6.612e-05 1.659e-04 0.399 0.695
## percent_under_125000 7.987e-06 7.643e-06 1.045 0.311
## avg_household_size 1.651e-06 3.631e-04 0.005 0.996
## pop_density -8.983e-03 1.437e-02 -0.625 0.540
## `percent more than 1 occupant` -9.175e-06 1.546e-05 -0.594 0.561
## `percent more than 1 unit` 2.276e-06 7.157e-06 0.318 0.754
## avg_median_age -4.145e-06 2.894e-05 -0.143 0.888
##
## Residual standard error: 0.0003107 on 17 degrees of freedom
## Multiple R-squared: 0.1555, Adjusted R-squared: -0.1922
## F-statistic: 0.4472 on 7 and 17 DF, p-value: 0.8586
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.774e-04 -1.546e-04 -8.217e-05 2.702e-05 9.709e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.581e-05 2.312e-04 -0.112 0.912
## total_visits_per_capita 8.601e-05 7.446e-05 1.155 0.260
##
## Residual standard error: 0.0002826 on 23 degrees of freedom
## Multiple R-squared: 0.05482, Adjusted R-squared: 0.01373
## F-statistic: 1.334 on 1 and 23 DF, p-value: 0.2599
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.170e-04 -1.518e-04 -8.907e-05 1.306e-04 8.255e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.655e-04 2.046e-03 -0.130 0.898
## total_visits_per_capita 6.612e-05 1.659e-04 0.399 0.695
## percent_under_125000 7.987e-06 7.643e-06 1.045 0.311
## avg_household_size 1.651e-06 3.631e-04 0.005 0.996
## pop_density -8.983e-03 1.437e-02 -0.625 0.540
## `percent more than 1 occupant` -9.175e-06 1.546e-05 -0.594 0.561
## `percent more than 1 unit` 2.276e-06 7.157e-06 0.318 0.754
## avg_median_age -4.145e-06 2.894e-05 -0.143 0.888
##
## Residual standard error: 0.0003107 on 17 degrees of freedom
## Multiple R-squared: 0.1555, Adjusted R-squared: -0.1922
## F-statistic: 0.4472 on 7 and 17 DF, p-value: 0.8586
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.12396 -0.06851 -0.02184 0.05074 0.23629
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.02350 0.07295 -0.322 0.7503
## total_visits_per_capita 0.05184 0.02350 2.206 0.0376 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.08917 on 23 degrees of freedom
## Multiple R-squared: 0.1747, Adjusted R-squared: 0.1388
## F-statistic: 4.868 on 1 and 23 DF, p-value: 0.03762
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.12443 -0.06108 -0.01012 0.06673 0.21339
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.038803 0.651835 0.060 0.953
## total_visits_per_capita 0.032154 0.052839 0.609 0.551
## percent_under_125000 0.002491 0.002435 1.023 0.321
## avg_household_size -0.031278 0.115668 -0.270 0.790
## pop_density -0.091926 4.578454 -0.020 0.984
## `percent more than 1 occupant` -0.003069 0.004924 -0.623 0.541
## `percent more than 1 unit` -0.000745 0.002280 -0.327 0.748
## avg_median_age 0.000159 0.009219 0.017 0.986
##
## Residual standard error: 0.09897 on 17 degrees of freedom
## Multiple R-squared: 0.2485, Adjusted R-squared: -0.06098
## F-statistic: 0.8029 on 7 and 17 DF, p-value: 0.5961
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0002461 -0.0001823 -0.0001103 0.0001408 0.0009349
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.054e-04 3.497e-04 0.587 0.564
## total_visits_per_capita 1.861e-05 1.075e-04 0.173 0.864
##
## Residual standard error: 0.0002962 on 20 degrees of freedom
## Multiple R-squared: 0.001496, Adjusted R-squared: -0.04843
## F-statistic: 0.02996 on 1 and 20 DF, p-value: 0.8643
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.727e-04 -1.476e-04 -2.294e-05 3.853e-05 6.508e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.033e-03 2.522e-03 -0.410 0.688
## total_visits_per_capita -1.454e-04 2.163e-04 -0.672 0.512
## percent_under_125000 8.068e-06 8.479e-06 0.951 0.358
## avg_household_size 1.117e-04 4.598e-04 0.243 0.812
## pop_density -2.630e-02 2.286e-02 -1.150 0.269
## `percent more than 1 occupant` 1.050e-05 3.380e-05 0.311 0.761
## `percent more than 1 unit` 4.669e-06 9.015e-06 0.518 0.613
## avg_median_age 2.301e-05 3.630e-05 0.634 0.536
##
## Residual standard error: 0.0003034 on 14 degrees of freedom
## Multiple R-squared: 0.267, Adjusted R-squared: -0.09957
## F-statistic: 0.7284 on 7 and 14 DF, p-value: 0.6516
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.118302 -0.078913 -0.004338 0.055414 0.217143
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.09902 0.10548 0.939 0.359
## total_visits_per_capita 0.01614 0.03243 0.498 0.624
##
## Residual standard error: 0.08935 on 20 degrees of freedom
## Multiple R-squared: 0.01224, Adjusted R-squared: -0.03715
## F-statistic: 0.2478 on 1 and 20 DF, p-value: 0.6241
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.09083 -0.03993 -0.02074 0.04966 0.13942
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.3265922 0.6427536 -0.508 0.619
## total_visits_per_capita -0.0626193 0.0551274 -1.136 0.275
## percent_under_125000 0.0024144 0.0021609 1.117 0.283
## avg_household_size 0.0217460 0.1171768 0.186 0.855
## pop_density -4.2302348 5.8263517 -0.726 0.480
## `percent more than 1 occupant` 0.0059665 0.0086131 0.693 0.500
## `percent more than 1 unit` 0.0002237 0.0022976 0.097 0.924
## avg_median_age 0.0122078 0.0092517 1.320 0.208
##
## Residual standard error: 0.07731 on 14 degrees of freedom
## Multiple R-squared: 0.4823, Adjusted R-squared: 0.2235
## F-statistic: 1.863 on 7 and 14 DF, p-value: 0.1523
##
## [1] "Cases start date: 2020-04-28"
## [1] "Visits start date: 2020-04-14"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0003281 -0.0001878 -0.0000342 0.0001046 0.0004986
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.227e-04 1.860e-04 -1.198 0.2433
## total_visits_per_capita 1.288e-04 5.365e-05 2.401 0.0248 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.000226 on 23 degrees of freedom
## Multiple R-squared: 0.2004, Adjusted R-squared: 0.1656
## F-statistic: 5.764 on 1 and 23 DF, p-value: 0.02484
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.289e-04 -1.448e-04 -5.830e-06 7.845e-05 4.667e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7.953e-04 1.585e-03 -0.502 0.622
## total_visits_per_capita 1.488e-04 1.298e-04 1.146 0.268
## percent_under_125000 1.444e-06 6.321e-06 0.228 0.822
## avg_household_size 1.031e-04 2.863e-04 0.360 0.723
## pop_density 1.175e-02 1.186e-02 0.991 0.336
## `percent more than 1 occupant` 5.408e-06 1.291e-05 0.419 0.680
## `percent more than 1 unit` 1.909e-06 5.501e-06 0.347 0.733
## avg_median_age -2.390e-06 2.326e-05 -0.103 0.919
##
## Residual standard error: 0.0002381 on 17 degrees of freedom
## Multiple R-squared: 0.3437, Adjusted R-squared: 0.07342
## F-statistic: 1.272 on 7 and 17 DF, p-value: 0.3209
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0003281 -0.0001878 -0.0000342 0.0001046 0.0004986
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.227e-04 1.860e-04 -1.198 0.2433
## total_visits_per_capita 1.288e-04 5.365e-05 2.401 0.0248 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.000226 on 23 degrees of freedom
## Multiple R-squared: 0.2004, Adjusted R-squared: 0.1656
## F-statistic: 5.764 on 1 and 23 DF, p-value: 0.02484
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.289e-04 -1.448e-04 -5.830e-06 7.845e-05 4.667e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7.953e-04 1.585e-03 -0.502 0.622
## total_visits_per_capita 1.488e-04 1.298e-04 1.146 0.268
## percent_under_125000 1.444e-06 6.321e-06 0.228 0.822
## avg_household_size 1.031e-04 2.863e-04 0.360 0.723
## pop_density 1.175e-02 1.186e-02 0.991 0.336
## `percent more than 1 occupant` 5.408e-06 1.291e-05 0.419 0.680
## `percent more than 1 unit` 1.909e-06 5.501e-06 0.347 0.733
## avg_median_age -2.390e-06 2.326e-05 -0.103 0.919
##
## Residual standard error: 0.0002381 on 17 degrees of freedom
## Multiple R-squared: 0.3437, Adjusted R-squared: 0.07342
## F-statistic: 1.272 on 7 and 17 DF, p-value: 0.3209
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.15098 -0.05555 -0.00507 0.04396 0.17610
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.06915 0.06713 -1.030 0.3137
## total_visits_per_capita 0.05148 0.01937 2.658 0.0141 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.08157 on 23 degrees of freedom
## Multiple R-squared: 0.235, Adjusted R-squared: 0.2017
## F-statistic: 7.065 on 1 and 23 DF, p-value: 0.01405
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.148339 -0.039165 0.008371 0.032601 0.111044
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.3033449 0.5494907 -0.552 0.5881
## total_visits_per_capita 0.0615037 0.0450117 1.366 0.1896
## percent_under_125000 0.0002300 0.0021917 0.105 0.9176
## avg_household_size 0.0216058 0.0992784 0.218 0.8303
## pop_density 7.3810671 4.1112744 1.795 0.0904 .
## `percent more than 1 occupant` 0.0012334 0.0044748 0.276 0.7861
## `percent more than 1 unit` 0.0001144 0.0019073 0.060 0.9529
## avg_median_age 0.0013846 0.0080639 0.172 0.8657
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.08257 on 17 degrees of freedom
## Multiple R-squared: 0.4206, Adjusted R-squared: 0.1821
## F-statistic: 1.763 on 7 and 17 DF, p-value: 0.1605
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0003280 -0.0002026 -0.0000667 0.0001327 0.0004974
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.178e-04 2.941e-04 -0.741 0.468
## total_visits_per_capita 1.276e-04 8.088e-05 1.578 0.130
##
## Residual standard error: 0.0002421 on 20 degrees of freedom
## Multiple R-squared: 0.1107, Adjusted R-squared: 0.06625
## F-statistic: 2.49 on 1 and 20 DF, p-value: 0.1303
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.071e-04 -1.378e-04 -4.929e-05 7.571e-05 4.878e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.339e-05 1.921e-03 0.007 0.995
## total_visits_per_capita 1.339e-04 1.514e-04 0.885 0.391
## percent_under_125000 -5.712e-07 6.602e-06 -0.087 0.932
## avg_household_size -1.086e-05 3.360e-04 -0.032 0.975
## pop_density 2.673e-02 1.857e-02 1.440 0.172
## `percent more than 1 occupant` 2.574e-05 2.494e-05 1.032 0.320
## `percent more than 1 unit` -1.586e-06 6.785e-06 -0.234 0.819
## avg_median_age -1.198e-05 2.764e-05 -0.434 0.671
##
## Residual standard error: 0.0002352 on 14 degrees of freedom
## Multiple R-squared: 0.4121, Adjusted R-squared: 0.1182
## F-statistic: 1.402 on 7 and 14 DF, p-value: 0.2791
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.145268 -0.057158 0.004115 0.059673 0.168587
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.02139 0.10507 -0.204 0.841
## total_visits_per_capita 0.03897 0.02890 1.349 0.193
##
## Residual standard error: 0.08649 on 20 degrees of freedom
## Multiple R-squared: 0.08336, Adjusted R-squared: 0.03753
## F-statistic: 1.819 on 1 and 20 DF, p-value: 0.1925
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.108834 -0.042472 0.004964 0.042425 0.103401
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.2424422 0.5635049 -0.430 0.67357
## total_visits_per_capita 0.0533436 0.0443922 1.202 0.24944
## percent_under_125000 -0.0001407 0.0019363 -0.073 0.94308
## avg_household_size 0.0203076 0.0985442 0.206 0.83970
## pop_density 16.7924651 5.4449416 3.084 0.00808 **
## `percent more than 1 occupant` 0.0042643 0.0073151 0.583 0.56920
## `percent more than 1 unit` -0.0005039 0.0019899 -0.253 0.80378
## avg_median_age -0.0001340 0.0081072 -0.017 0.98705
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.06899 on 14 degrees of freedom
## Multiple R-squared: 0.5917, Adjusted R-squared: 0.3875
## F-statistic: 2.898 on 7 and 14 DF, p-value: 0.04279
##
## [1] "Cases start date: 2020-05-05"
## [1] "Visits start date: 2020-04-21"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.768e-04 -1.841e-04 -7.733e-05 1.036e-04 8.908e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.124e-04 2.256e-04 -0.498 0.623
## total_visits_per_capita 9.479e-05 6.504e-05 1.457 0.159
##
## Residual standard error: 0.0002588 on 23 degrees of freedom
## Multiple R-squared: 0.08452, Adjusted R-squared: 0.04472
## F-statistic: 2.124 on 1 and 23 DF, p-value: 0.1586
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.942e-04 -1.590e-04 -1.839e-05 9.463e-05 7.234e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.395e-04 1.683e-03 -0.261 0.797
## total_visits_per_capita 6.538e-05 1.252e-04 0.522 0.608
## percent_under_125000 2.439e-06 6.176e-06 0.395 0.698
## avg_household_size 2.626e-04 2.961e-04 0.887 0.388
## pop_density 1.083e-02 1.217e-02 0.890 0.386
## `percent more than 1 occupant` 4.132e-06 1.342e-05 0.308 0.762
## `percent more than 1 unit` 4.623e-06 5.868e-06 0.788 0.442
## avg_median_age -1.950e-05 2.369e-05 -0.823 0.422
##
## Residual standard error: 0.0002546 on 17 degrees of freedom
## Multiple R-squared: 0.3453, Adjusted R-squared: 0.07568
## F-statistic: 1.281 on 7 and 17 DF, p-value: 0.3169
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.768e-04 -1.841e-04 -7.733e-05 1.036e-04 8.908e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.124e-04 2.256e-04 -0.498 0.623
## total_visits_per_capita 9.479e-05 6.504e-05 1.457 0.159
##
## Residual standard error: 0.0002588 on 23 degrees of freedom
## Multiple R-squared: 0.08452, Adjusted R-squared: 0.04472
## F-statistic: 2.124 on 1 and 23 DF, p-value: 0.1586
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.942e-04 -1.590e-04 -1.839e-05 9.463e-05 7.234e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.395e-04 1.683e-03 -0.261 0.797
## total_visits_per_capita 6.538e-05 1.252e-04 0.522 0.608
## percent_under_125000 2.439e-06 6.176e-06 0.395 0.698
## avg_household_size 2.626e-04 2.961e-04 0.887 0.388
## pop_density 1.083e-02 1.217e-02 0.890 0.386
## `percent more than 1 occupant` 4.132e-06 1.342e-05 0.308 0.762
## `percent more than 1 unit` 4.623e-06 5.868e-06 0.788 0.442
## avg_median_age -1.950e-05 2.369e-05 -0.823 0.422
##
## Residual standard error: 0.0002546 on 17 degrees of freedom
## Multiple R-squared: 0.3453, Adjusted R-squared: 0.07568
## F-statistic: 1.281 on 7 and 17 DF, p-value: 0.3169
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.11825 -0.06906 -0.01904 0.03104 0.20053
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.03113 0.07680 -0.405 0.689
## total_visits_per_capita 0.03638 0.02215 1.643 0.114
##
## Residual standard error: 0.08813 on 23 degrees of freedom
## Multiple R-squared: 0.105, Adjusted R-squared: 0.06608
## F-statistic: 2.698 on 1 and 23 DF, p-value: 0.1141
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.09636 -0.06722 -0.00187 0.03577 0.15816
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.4634069 0.5250376 0.883 0.3898
## total_visits_per_capita 0.0014609 0.0390421 0.037 0.9706
## percent_under_125000 0.0020703 0.0019265 1.075 0.2976
## avg_household_size 0.0460018 0.0923615 0.498 0.6248
## pop_density 1.5099166 3.7952486 0.398 0.6957
## `percent more than 1 occupant` 0.0010878 0.0041872 0.260 0.7981
## `percent more than 1 unit` 0.0004531 0.0018304 0.248 0.8075
## avg_median_age -0.0164208 0.0073902 -2.222 0.0401 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.07941 on 17 degrees of freedom
## Multiple R-squared: 0.4629, Adjusted R-squared: 0.2417
## F-statistic: 2.093 on 7 and 17 DF, p-value: 0.1012
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.648e-04 -1.968e-04 -5.409e-05 1.006e-04 8.828e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.685e-05 3.647e-04 0.101 0.921
## total_visits_per_capita 5.552e-05 1.004e-04 0.553 0.586
##
## Residual standard error: 0.000275 on 20 degrees of freedom
## Multiple R-squared: 0.01505, Adjusted R-squared: -0.03419
## F-statistic: 0.3057 on 1 and 20 DF, p-value: 0.5865
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.567e-04 -1.364e-04 -4.297e-05 1.000e-04 6.182e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.764e-04 1.981e-03 0.341 0.738
## total_visits_per_capita 1.754e-05 1.385e-04 0.127 0.901
## percent_under_125000 7.611e-08 6.086e-06 0.013 0.990
## avg_household_size 1.206e-04 3.249e-04 0.371 0.716
## pop_density 2.635e-02 1.827e-02 1.442 0.171
## `percent more than 1 occupant` 3.168e-05 2.510e-05 1.262 0.228
## `percent more than 1 unit` 1.901e-07 6.829e-06 0.028 0.978
## avg_median_age -3.127e-05 2.827e-05 -1.106 0.287
##
## Residual standard error: 0.0002413 on 14 degrees of freedom
## Multiple R-squared: 0.4694, Adjusted R-squared: 0.2041
## F-statistic: 1.769 on 7 and 14 DF, p-value: 0.1721
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.11092 -0.07088 -0.01606 0.05445 0.19594
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.05774 0.12213 0.473 0.641
## total_visits_per_capita 0.01295 0.03363 0.385 0.704
##
## Residual standard error: 0.09211 on 20 degrees of freedom
## Multiple R-squared: 0.00736, Adjusted R-squared: -0.04227
## F-statistic: 0.1483 on 1 and 20 DF, p-value: 0.7042
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.088113 -0.038366 0.000876 0.014501 0.125525
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.018501 0.588088 1.732 0.1053
## total_visits_per_capita -0.014207 0.041122 -0.345 0.7349
## percent_under_125000 0.001043 0.001807 0.577 0.5729
## avg_household_size -0.027640 0.096443 -0.287 0.7786
## pop_density 5.873914 5.422792 1.083 0.2970
## `percent more than 1 occupant` 0.013354 0.007451 1.792 0.0947 .
## `percent more than 1 unit` -0.001600 0.002027 -0.789 0.4431
## avg_median_age -0.022424 0.008391 -2.672 0.0182 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.07162 on 14 degrees of freedom
## Multiple R-squared: 0.5798, Adjusted R-squared: 0.3697
## F-statistic: 2.76 on 7 and 14 DF, p-value: 0.05025
##
## [1] "Cases start date: 2020-05-12"
## [1] "Visits start date: 2020-04-28"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.615e-04 -1.337e-04 -7.965e-05 4.174e-05 5.012e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.189e-05 1.735e-04 -0.357 0.725
## total_visits_per_capita 8.578e-05 5.114e-05 1.678 0.107
##
## Residual standard error: 0.0002349 on 23 degrees of freedom
## Multiple R-squared: 0.109, Adjusted R-squared: 0.07027
## F-statistic: 2.814 on 1 and 23 DF, p-value: 0.107
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.866e-04 -1.237e-04 -4.059e-05 6.818e-05 4.344e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.962e-04 1.407e-03 -0.637 0.533
## total_visits_per_capita 5.766e-05 1.036e-04 0.556 0.585
## percent_under_125000 6.099e-06 5.377e-06 1.134 0.272
## avg_household_size 1.704e-04 2.591e-04 0.657 0.520
## pop_density 1.538e-02 9.945e-03 1.546 0.140
## `percent more than 1 occupant` -5.690e-08 1.173e-05 -0.005 0.996
## `percent more than 1 unit` 2.494e-06 4.958e-06 0.503 0.621
## avg_median_age -3.160e-06 2.047e-05 -0.154 0.879
##
## Residual standard error: 0.0002148 on 17 degrees of freedom
## Multiple R-squared: 0.4492, Adjusted R-squared: 0.2224
## F-statistic: 1.981 on 7 and 17 DF, p-value: 0.1183
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.615e-04 -1.337e-04 -7.965e-05 4.174e-05 5.012e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.189e-05 1.735e-04 -0.357 0.725
## total_visits_per_capita 8.578e-05 5.114e-05 1.678 0.107
##
## Residual standard error: 0.0002349 on 23 degrees of freedom
## Multiple R-squared: 0.109, Adjusted R-squared: 0.07027
## F-statistic: 2.814 on 1 and 23 DF, p-value: 0.107
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.866e-04 -1.237e-04 -4.059e-05 6.818e-05 4.344e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.962e-04 1.407e-03 -0.637 0.533
## total_visits_per_capita 5.766e-05 1.036e-04 0.556 0.585
## percent_under_125000 6.099e-06 5.377e-06 1.134 0.272
## avg_household_size 1.704e-04 2.591e-04 0.657 0.520
## pop_density 1.538e-02 9.945e-03 1.546 0.140
## `percent more than 1 occupant` -5.690e-08 1.173e-05 -0.005 0.996
## `percent more than 1 unit` 2.494e-06 4.958e-06 0.503 0.621
## avg_median_age -3.160e-06 2.047e-05 -0.154 0.879
##
## Residual standard error: 0.0002148 on 17 degrees of freedom
## Multiple R-squared: 0.4492, Adjusted R-squared: 0.2224
## F-statistic: 1.981 on 7 and 17 DF, p-value: 0.1183
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.36834 -0.15675 -0.06918 0.02667 2.13471
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.43724 0.34831 1.255 0.222
## total_visits_per_capita -0.08044 0.10262 -0.784 0.441
##
## Residual standard error: 0.4714 on 23 degrees of freedom
## Multiple R-squared: 0.02602, Adjusted R-squared: -0.01633
## F-statistic: 0.6144 on 1 and 23 DF, p-value: 0.4411
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.55204 -0.19537 -0.00273 0.07386 1.11480
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.8416629 2.5538519 -0.721 0.48063
## total_visits_per_capita -0.0283566 0.1881359 -0.151 0.88197
## percent_under_125000 -0.0009192 0.0097621 -0.094 0.92608
## avg_household_size 0.2043714 0.4704457 0.434 0.66945
## pop_density 64.1914649 18.0548882 3.555 0.00243 **
## `percent more than 1 occupant` 0.0027126 0.0212865 0.127 0.90009
## `percent more than 1 unit` 0.0017069 0.0090011 0.190 0.85185
## avg_median_age 0.0246596 0.0371598 0.664 0.51584
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3899 on 17 degrees of freedom
## Multiple R-squared: 0.5073, Adjusted R-squared: 0.3045
## F-statistic: 2.501 on 7 and 17 DF, p-value: 0.05811
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.798e-04 -1.179e-04 -7.617e-05 4.202e-05 5.472e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.320e-04 2.567e-04 -0.903 0.3770
## total_visits_per_capita 1.295e-04 7.196e-05 1.800 0.0869 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0002272 on 20 degrees of freedom
## Multiple R-squared: 0.1394, Adjusted R-squared: 0.09641
## F-statistic: 3.241 on 1 and 20 DF, p-value: 0.08694
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.500e-04 -8.507e-05 -3.788e-05 4.861e-05 4.101e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7.463e-06 1.851e-03 -0.004 0.997
## total_visits_per_capita 3.799e-05 1.250e-04 0.304 0.766
## percent_under_125000 4.925e-06 5.898e-06 0.835 0.418
## avg_household_size 4.337e-05 3.152e-04 0.138 0.893
## pop_density 5.783e-03 1.670e-02 0.346 0.734
## `percent more than 1 occupant` 1.812e-05 2.369e-05 0.765 0.457
## `percent more than 1 unit` -8.526e-08 6.432e-06 -0.013 0.990
## avg_median_age -1.101e-05 2.665e-05 -0.413 0.686
##
## Residual standard error: 0.0002264 on 14 degrees of freedom
## Multiple R-squared: 0.4019, Adjusted R-squared: 0.1028
## F-statistic: 1.344 on 7 and 14 DF, p-value: 0.3014
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.088430 -0.035836 -0.003518 0.038091 0.086826
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.08115 0.06131 -1.324 0.2005
## total_visits_per_capita 0.04862 0.01718 2.830 0.0104 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.05425 on 20 degrees of freedom
## Multiple R-squared: 0.2859, Adjusted R-squared: 0.2502
## F-statistic: 8.006 on 1 and 20 DF, p-value: 0.01036
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.075996 -0.021359 -0.005603 0.033111 0.085405
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.1443514 0.4643570 -0.311 0.7605
## total_visits_per_capita 0.0578783 0.0313458 1.846 0.0861 .
## percent_under_125000 0.0006009 0.0014794 0.406 0.6907
## avg_household_size -0.0339883 0.0790828 -0.430 0.6739
## pop_density 4.9598480 4.1904011 1.184 0.2563
## `percent more than 1 occupant` 0.0006771 0.0059429 0.114 0.9109
## `percent more than 1 unit` -0.0006150 0.0016134 -0.381 0.7088
## avg_median_age 0.0019231 0.0066847 0.288 0.7778
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.05679 on 14 degrees of freedom
## Multiple R-squared: 0.4522, Adjusted R-squared: 0.1782
## F-statistic: 1.651 on 7 and 14 DF, p-value: 0.2011
##
## [1] "Cases start date: 2020-05-19"
## [1] "Visits start date: 2020-05-05"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.274e-04 -8.276e-05 -2.423e-05 5.395e-05 2.091e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.105e-04 9.369e-05 -1.180 0.2512
## total_visits_per_capita 5.810e-05 2.791e-05 2.082 0.0498 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 9.615e-05 on 21 degrees of freedom
## Multiple R-squared: 0.1711, Adjusted R-squared: 0.1316
## F-statistic: 4.334 on 1 and 21 DF, p-value: 0.04978
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.869e-04 -4.605e-05 -1.271e-05 6.014e-05 1.083e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.574e-04 7.004e-04 0.225 0.825
## total_visits_per_capita 5.758e-05 5.461e-05 1.054 0.308
## percent_under_125000 -1.211e-07 2.042e-06 -0.059 0.953
## avg_household_size 1.711e-05 1.236e-04 0.138 0.892
## pop_density -2.251e-03 6.041e-03 -0.373 0.715
## `percent more than 1 occupant` 1.409e-05 8.733e-06 1.613 0.128
## `percent more than 1 unit` 6.573e-07 2.432e-06 0.270 0.791
## avg_median_age -1.051e-05 1.001e-05 -1.050 0.311
##
## Residual standard error: 8.586e-05 on 15 degrees of freedom
## Multiple R-squared: 0.5278, Adjusted R-squared: 0.3074
## F-statistic: 2.395 on 7 and 15 DF, p-value: 0.07374
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.274e-04 -8.276e-05 -2.423e-05 5.395e-05 2.091e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.105e-04 9.369e-05 -1.180 0.2512
## total_visits_per_capita 5.810e-05 2.791e-05 2.082 0.0498 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 9.615e-05 on 21 degrees of freedom
## Multiple R-squared: 0.1711, Adjusted R-squared: 0.1316
## F-statistic: 4.334 on 1 and 21 DF, p-value: 0.04978
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.869e-04 -4.605e-05 -1.271e-05 6.014e-05 1.083e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.574e-04 7.004e-04 0.225 0.825
## total_visits_per_capita 5.758e-05 5.461e-05 1.054 0.308
## percent_under_125000 -1.211e-07 2.042e-06 -0.059 0.953
## avg_household_size 1.711e-05 1.236e-04 0.138 0.892
## pop_density -2.251e-03 6.041e-03 -0.373 0.715
## `percent more than 1 occupant` 1.409e-05 8.733e-06 1.613 0.128
## `percent more than 1 unit` 6.573e-07 2.432e-06 0.270 0.791
## avg_median_age -1.051e-05 1.001e-05 -1.050 0.311
##
## Residual standard error: 8.586e-05 on 15 degrees of freedom
## Multiple R-squared: 0.5278, Adjusted R-squared: 0.3074
## F-statistic: 2.395 on 7 and 15 DF, p-value: 0.07374
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.042542 -0.019802 -0.009096 0.007868 0.134528
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.01817 0.03837 -0.473 0.641
## total_visits_per_capita 0.01483 0.01143 1.297 0.209
##
## Residual standard error: 0.03938 on 21 degrees of freedom
## Multiple R-squared: 0.07417, Adjusted R-squared: 0.03009
## F-statistic: 1.682 on 1 and 21 DF, p-value: 0.2087
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.043135 -0.019963 -0.002531 0.023350 0.062105
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0079016 0.2741853 0.029 0.9774
## total_visits_per_capita 0.0532616 0.0213762 2.492 0.0249 *
## percent_under_125000 -0.0013541 0.0007992 -1.694 0.1109
## avg_household_size -0.0246897 0.0483695 -0.510 0.6172
## pop_density 2.6243586 2.3647335 1.110 0.2846
## `percent more than 1 occupant` 0.0065490 0.0034185 1.916 0.0747 .
## `percent more than 1 unit` 0.0001732 0.0009520 0.182 0.8581
## avg_median_age -0.0023916 0.0039201 -0.610 0.5509
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.03361 on 15 degrees of freedom
## Multiple R-squared: 0.5183, Adjusted R-squared: 0.2935
## F-statistic: 2.306 on 7 and 15 DF, p-value: 0.08264
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.274e-04 -8.276e-05 -2.423e-05 5.395e-05 2.091e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.105e-04 9.369e-05 -1.180 0.2512
## total_visits_per_capita 5.810e-05 2.791e-05 2.082 0.0498 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 9.615e-05 on 21 degrees of freedom
## Multiple R-squared: 0.1711, Adjusted R-squared: 0.1316
## F-statistic: 4.334 on 1 and 21 DF, p-value: 0.04978
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.869e-04 -4.605e-05 -1.271e-05 6.014e-05 1.083e-04
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.574e-04 7.004e-04 0.225 0.825
## total_visits_per_capita 5.758e-05 5.461e-05 1.054 0.308
## percent_under_125000 -1.211e-07 2.042e-06 -0.059 0.953
## avg_household_size 1.711e-05 1.236e-04 0.138 0.892
## pop_density -2.251e-03 6.041e-03 -0.373 0.715
## `percent more than 1 occupant` 1.409e-05 8.733e-06 1.613 0.128
## `percent more than 1 unit` 6.573e-07 2.432e-06 0.270 0.791
## avg_median_age -1.051e-05 1.001e-05 -1.050 0.311
##
## Residual standard error: 8.586e-05 on 15 degrees of freedom
## Multiple R-squared: 0.5278, Adjusted R-squared: 0.3074
## F-statistic: 2.395 on 7 and 15 DF, p-value: 0.07374
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.042542 -0.019802 -0.009096 0.007868 0.134528
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.01817 0.03837 -0.473 0.641
## total_visits_per_capita 0.01483 0.01143 1.297 0.209
##
## Residual standard error: 0.03938 on 21 degrees of freedom
## Multiple R-squared: 0.07417, Adjusted R-squared: 0.03009
## F-statistic: 1.682 on 1 and 21 DF, p-value: 0.2087
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.043135 -0.019963 -0.002531 0.023350 0.062105
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0079016 0.2741853 0.029 0.9774
## total_visits_per_capita 0.0532616 0.0213762 2.492 0.0249 *
## percent_under_125000 -0.0013541 0.0007992 -1.694 0.1109
## avg_household_size -0.0246897 0.0483695 -0.510 0.6172
## pop_density 2.6243586 2.3647335 1.110 0.2846
## `percent more than 1 occupant` 0.0065490 0.0034185 1.916 0.0747 .
## `percent more than 1 unit` 0.0001732 0.0009520 0.182 0.8581
## avg_median_age -0.0023916 0.0039201 -0.610 0.5509
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.03361 on 15 degrees of freedom
## Multiple R-squared: 0.5183, Adjusted R-squared: 0.2935
## F-statistic: 2.306 on 7 and 15 DF, p-value: 0.08264
##
## [1] "Cases start date: 2020-05-26"
## [1] "Visits start date: 2020-05-12"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 21 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 21 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 15 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 15 DF, p-value: NA
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 21 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 21 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 15 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 15 DF, p-value: NA
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 21 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 21 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 15 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 15 DF, p-value: NA
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 21 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 21 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 15 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 15 DF, p-value: NA
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 21 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 21 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 15 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 15 DF, p-value: NA
##
## [1] "Cases start date: 2020-06-02"
## [1] "Visits start date: 2020-05-19"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 23 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 23 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 17 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 17 DF, p-value: NA
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 23 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 23 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 17 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 17 DF, p-value: NA
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 23 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 23 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 17 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 17 DF, p-value: NA
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 21 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 21 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 15 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 15 DF, p-value: NA
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 21 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 21 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 15 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 15 DF, p-value: NA
##
## [1] "Cases start date: 2020-06-09"
## [1] "Visits start date: 2020-05-26"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 23 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 23 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 17 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 17 DF, p-value: NA
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 23 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 23 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 17 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 17 DF, p-value: NA
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 23 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 23 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 17 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 17 DF, p-value: NA
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 21 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 21 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 15 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 15 DF, p-value: NA
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
##
## Residual standard error: 0 on 21 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 1 and 21 DF, p-value: NA
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## 0 0 0 0 0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0 0 NA NA
## total_visits_per_capita 0 0 NA NA
## percent_under_125000 0 0 NA NA
## avg_household_size 0 0 NA NA
## pop_density 0 0 NA NA
## `percent more than 1 occupant` 0 0 NA NA
## `percent more than 1 unit` 0 0 NA NA
## avg_median_age 0 0 NA NA
##
## Residual standard error: 0 on 15 degrees of freedom
## Multiple R-squared: NaN, Adjusted R-squared: NaN
## F-statistic: NaN on 7 and 15 DF, p-value: NA
##
## [1] "Cases start date: 2020-06-16"
## [1] "Visits start date: 2020-06-02"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0009620 -0.0005281 -0.0003028 0.0002334 0.0028778
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0003004 0.0006073 0.495 0.626
## total_visits_per_capita 0.0002213 0.0002067 1.070 0.296
##
## Residual standard error: 0.000974 on 23 degrees of freedom
## Multiple R-squared: 0.04745, Adjusted R-squared: 0.006038
## F-statistic: 1.146 on 1 and 23 DF, p-value: 0.2955
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0012981 -0.0004177 -0.0001021 0.0002200 0.0016078
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.213e-03 5.301e-03 0.795 0.4377
## total_visits_per_capita -3.921e-04 4.026e-04 -0.974 0.3437
## percent_under_125000 4.608e-05 1.708e-05 2.698 0.0152 *
## avg_household_size 6.736e-04 9.600e-04 0.702 0.4924
## pop_density 8.987e-04 3.728e-02 0.024 0.9810
## `percent more than 1 occupant` -2.371e-05 3.907e-05 -0.607 0.5519
## `percent more than 1 unit` -4.326e-06 1.880e-05 -0.230 0.8208
## avg_median_age -1.484e-04 7.267e-05 -2.042 0.0569 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0008065 on 17 degrees of freedom
## Multiple R-squared: 0.5173, Adjusted R-squared: 0.3185
## F-statistic: 2.602 on 7 and 17 DF, p-value: 0.0508
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0009620 -0.0005281 -0.0003028 0.0002334 0.0028778
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0003004 0.0006073 0.495 0.626
## total_visits_per_capita 0.0002213 0.0002067 1.070 0.296
##
## Residual standard error: 0.000974 on 23 degrees of freedom
## Multiple R-squared: 0.04745, Adjusted R-squared: 0.006038
## F-statistic: 1.146 on 1 and 23 DF, p-value: 0.2955
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0012981 -0.0004177 -0.0001021 0.0002200 0.0016078
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.213e-03 5.301e-03 0.795 0.4377
## total_visits_per_capita -3.921e-04 4.026e-04 -0.974 0.3437
## percent_under_125000 4.608e-05 1.708e-05 2.698 0.0152 *
## avg_household_size 6.736e-04 9.600e-04 0.702 0.4924
## pop_density 8.987e-04 3.728e-02 0.024 0.9810
## `percent more than 1 occupant` -2.371e-05 3.907e-05 -0.607 0.5519
## `percent more than 1 unit` -4.326e-06 1.880e-05 -0.230 0.8208
## avg_median_age -1.484e-04 7.267e-05 -2.042 0.0569 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0008065 on 17 degrees of freedom
## Multiple R-squared: 0.5173, Adjusted R-squared: 0.3185
## F-statistic: 2.602 on 7 and 17 DF, p-value: 0.0508
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_start_non0)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.21965 -0.12261 -0.04057 0.07272 0.34588
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.16525 0.10290 1.606 0.122
## total_visits_per_capita 0.05287 0.03503 1.509 0.145
##
## Residual standard error: 0.165 on 23 degrees of freedom
## Multiple R-squared: 0.09012, Adjusted R-squared: 0.05056
## F-statistic: 2.278 on 1 and 23 DF, p-value: 0.1448
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_non0_dem)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.190188 -0.054594 -0.004917 0.057873 0.272642
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.853982 0.788991 2.350 0.03112 *
## total_visits_per_capita -0.027343 0.059920 -0.456 0.65393
## percent_under_125000 0.007200 0.002542 2.832 0.01150 *
## avg_household_size -0.094633 0.142875 -0.662 0.51663
## pop_density 11.487260 5.547943 2.071 0.05394 .
## `percent more than 1 occupant` -0.002565 0.005815 -0.441 0.66472
## `percent more than 1 unit` -0.004675 0.002799 -1.671 0.11313
## avg_median_age -0.035178 0.010815 -3.253 0.00469 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.12 on 17 degrees of freedom
## Multiple R-squared: 0.6443, Adjusted R-squared: 0.4978
## F-statistic: 4.399 on 7 and 17 DF, p-value: 0.005935
##
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita, data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0008710 -0.0006442 -0.0003793 0.0001825 0.0029507
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.475e-04 7.912e-04 0.945 0.356
## total_visits_per_capita 8.438e-05 2.594e-04 0.325 0.748
##
## Residual standard error: 0.0009994 on 21 degrees of freedom
## Multiple R-squared: 0.005013, Adjusted R-squared: -0.04237
## F-statistic: 0.1058 on 1 and 21 DF, p-value: 0.7482
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.463e-03 -3.564e-04 2.801e-05 2.817e-04 1.395e-03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.477e-03 6.656e-03 1.123 0.2790
## total_visits_per_capita -4.744e-04 4.869e-04 -0.974 0.3453
## percent_under_125000 3.703e-05 1.872e-05 1.978 0.0666 .
## avg_household_size 1.226e-04 1.173e-03 0.105 0.9181
## pop_density -2.737e-02 5.491e-02 -0.498 0.6254
## `percent more than 1 occupant` 6.673e-05 8.389e-05 0.795 0.4387
## `percent more than 1 unit` -1.588e-05 2.298e-05 -0.691 0.5001
## avg_median_age -1.666e-04 9.651e-05 -1.727 0.1048
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.0008163 on 15 degrees of freedom
## Multiple R-squared: 0.5259, Adjusted R-squared: 0.3046
## F-statistic: 2.377 on 7 and 15 DF, p-value: 0.07547
##
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita,
## data = visits_cases_change_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.18530 -0.11694 -0.05980 0.09713 0.29586
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.354221 0.119196 2.972 0.00728 **
## total_visits_per_capita -0.004996 0.039083 -0.128 0.89950
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1506 on 21 degrees of freedom
## Multiple R-squared: 0.0007776, Adjusted R-squared: -0.0468
## F-statistic: 0.01634 on 1 and 21 DF, p-value: 0.8995
##
## [1] "Control for demographic variables:"
##
## Call:
## lm(formula = change_log_cases_by_pop ~ total_visits_per_capita +
## percent_under_125000 + avg_household_size + pop_density +
## `percent more than 1 occupant` + `percent more than 1 unit` +
## avg_median_age, data = visits_cases_change_dem_exc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.169348 -0.062050 -0.001605 0.040019 0.292237
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.493038 0.989902 2.518 0.0236 *
## total_visits_per_capita -0.023949 0.072411 -0.331 0.7454
## percent_under_125000 0.005923 0.002784 2.128 0.0504 .
## avg_household_size -0.201873 0.174406 -1.157 0.2652
## pop_density 9.389791 8.166134 1.150 0.2682
## `percent more than 1 occupant` 0.011411 0.012476 0.915 0.3749
## `percent more than 1 unit` -0.006852 0.003417 -2.005 0.0634 .
## avg_median_age -0.041333 0.014354 -2.880 0.0115 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1214 on 15 degrees of freedom
## Multiple R-squared: 0.536, Adjusted R-squared: 0.3195
## F-statistic: 2.476 on 7 and 15 DF, p-value: 0.06661
model_results_1_sf <- model_results_1_sf %>%
mutate(visits_start_date = as.Date(cases_start_date) - visits_lag)
model_results_1_sf %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~r_squared, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~r_squared, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "R squared for that model"), title = "R squared over time, 1 week time interval, 14 day lag, SF")
model_results_1_sf %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "Visits coefficient for that model"), title = "Visits coefficient over time, 1 week time interval, 14 day lag, SF")
# split the log and not log for coefficient since log coefficient is much larger
model_results_1_sf %>% filter(model_type != "change in log of cases, starting above 0" & model_type != "change in log of cases, starting above 10") %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~coef_val, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "Visits coefficient for that model"), title = "Visits coefficient over time, 1 week time interval, 14 day lag, only non log, SF")
model_results_1_sf %>%
plot_ly() %>%
add_trace(x = ~visits_start_date, y = ~p_val, type = 'scatter', mode = 'markers', color = ~model_type) %>%
add_trace(x = ~visits_start_date, y = ~p_val, type = 'scatter', mode = 'lines', color = ~model_type, showlegend = F) %>%
layout(xaxis = list(title = "Start date of visits"), yaxis = list(title = "P value of coefficient for that model"), title = "P value of coefficient over time, 1 week time interval, 14 day lag, SF")
Hmm…what is going on with the missing data? Plot the SF case data to check.
sf_cases_zip %>% plot_ly() %>%
add_trace(x = ~date, y = ~cases_by_pop, color = ~zipcode, mode = "lines", type = "scatter")
Okay it looks like LA Times is just missing a bunch of SF data, or something weird was going on. So this method likely won’t be valid for SF data, unfortunately.